Vehicle path planning method, vehicle and readable storage medium
By performing grayscale conversion and adaptive optimization on the initial occupied grid, the problem of low accuracy in traditional obstacle recognition is solved, achieving high-precision and real-time obstacle detection and path planning, thus enhancing the robustness and reliability of the autonomous driving system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional rule-based or statistical obstacle recognition methods lack computational efficiency and real-time data processing capabilities in autonomous driving, resulting in low obstacle recognition accuracy.
By obtaining the probability of initial occupied grid, grayscale image conversion is performed. The obstacle area is optimized using an adaptive threshold and confidence weighted filtering mechanism. Combined with vehicle dynamic parameters and zero-copy conversion method, the target grayscale image is generated and converted into the target occupied grid for path planning.
It significantly improves the accuracy of obstacle detection and the robustness of path planning, thereby enhancing the real-time performance and reliability of autonomous driving systems.
Smart Images

Figure CN122015891A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and more specifically, to a vehicle path planning method, a vehicle, and a readable storage medium. Background Technology
[0002] In the field of autonomous driving technology, accurate obstacle recognition and map building are key components for achieving intelligent driving. However, traditional rule-based or statistical processing methods are inefficient in terms of computational efficiency and real-time data processing capabilities, resulting in low accuracy in obstacle recognition using existing technologies.
[0003] There is currently no good solution to the above problems. Summary of the Invention
[0004] This application provides a vehicle path planning method, a vehicle, and a readable storage medium to at least solve the technical problem of low accuracy in obstacle identification in related technologies.
[0005] According to one aspect of the embodiments of this application, a vehicle path planning method is provided, comprising: obtaining an initial occupied grid and an initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that an obstacle exists in the initial occupied grid; performing grayscale image conversion on the initial occupied grid based on the initial occupied probability, pixel grayscale value mapping relationship and zero-copy conversion method to obtain an initial grayscale image, wherein the zero-copy conversion method is used to convert between the occupied grid and the grayscale image based on memory address mapping relationship; determining the obstacle region in the initial grayscale image based on an adaptive threshold; optimizing the obstacle region based on vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain a target grayscale image; converting the target grayscale image into a target occupied grid through the zero-copy conversion method, and converting the pixel grayscale values of the target grayscale image into the target occupied probability of the target occupied grid through the pixel grayscale value mapping relationship; and planning the vehicle's driving path based on the target occupied grid and the target occupied probability.
[0006] Furthermore, the vehicle path planning method in this embodiment of the application further includes: obtaining a baseline threshold, vehicle speed, sensor noise variance, and driving environment dynamic indicators, wherein the baseline threshold is used as the initial value for adjusting the adaptive threshold, the sensor noise variance is used to measure the degree of fluctuation of sensor data, and the driving environment dynamic indicators are used to measure the degree of transient change of the current driving environment; the adaptive threshold is obtained by weighted summation of the baseline threshold, vehicle speed, sensor noise variance, driving environment dynamic indicators, and the local probability gradient of the initial occupancy probability.
[0007] Furthermore, the initial occupied raster is converted to grayscale based on the initial occupancy probability, the pixel grayscale value mapping relationship, and the zero-copy conversion method to obtain the initial grayscale image. This includes: determining the pixel grayscale value corresponding to the initial occupancy probability according to the initial occupancy probability and the pixel grayscale value mapping relationship; and converting the initial occupied raster according to the pixel grayscale value and the zero-copy conversion method to obtain the initial grayscale image.
[0008] Further, determining the obstacle region in the initial grayscale image based on the adaptive threshold includes: dividing the initial grayscale image into multiple regions based on pixel grayscale values; and determining the region whose pixel grayscale value is greater than or equal to the adaptive threshold as an obstacle region in response to any region having a pixel grayscale value greater than or equal to the adaptive threshold.
[0009] Furthermore, the vehicle dynamic parameters include: vehicle width, vehicle speed, and turning radius. Based on these vehicle dynamic parameters and a confidence-weighted filtering mechanism, the obstacle region is optimized to obtain a target grayscale image. This includes: determining the first obstacle boundary within the obstacle region based on a morphological operation kernel, wherein the size and shape of the morphological operation kernel are adjusted in real-time based on the vehicle width, vehicle speed, and turning radius; determining multiple obstacle regions and their areas based on the first obstacle boundary; removing regions with areas smaller than a first preset area threshold from the multiple obstacle regions to obtain the first obstacle region; filtering the first obstacle region using a confidence-weighted filtering mechanism to retain second obstacle regions within the first obstacle region with a confidence level greater than a preset confidence threshold; and further optimizing the second obstacle region to obtain the target grayscale image.
[0010] Further, the second obstacle region is further optimized to obtain a target grayscale image, including: removing regions in the second obstacle region whose area is smaller than a second preset area threshold to obtain a third obstacle region, wherein the second preset area threshold is smaller than a first preset area threshold; extracting the boundary of the second obstacle region in the third obstacle region based on a morphological operation kernel; completing and correcting the irregular and discontinuous boundaries in the boundary of the second obstacle region based on a contour interpolation method to obtain the boundary of the third obstacle region; determining a fourth obstacle region based on the boundary of the third obstacle region; and determining the target grayscale image based on the fourth obstacle region and the non-obstacle region, wherein the pixel grayscale value of the non-obstacle region is smaller than an adaptive threshold.
[0011] Furthermore, the vehicle's driving path is planned based on the target occupancy grid and the target occupancy probability, including: determining obstacle grids and non-obstacle grids in the target occupancy grid based on the target occupancy probability, wherein obstacle grids are used to represent grid cells with obstacles and non-obstacle grids are used to represent grid cells without obstacles; identifying obstacle grids and non-obstacle grids to obtain drivable areas; and planning the vehicle's driving path based on the drivable areas.
[0012] According to another aspect of the embodiments of this application, a vehicle path planning device is also provided, comprising: a first acquisition module, configured to acquire an initial occupied grid and an initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that an obstacle exists in the initial occupied grid; a first conversion module, configured to perform grayscale image conversion on the initial occupied grid based on the initial occupied probability, pixel grayscale value mapping relationship and zero-copy conversion method to obtain an initial grayscale image, wherein the zero-copy conversion method is used to convert between the occupied grid and the grayscale image based on memory address mapping relationship; a determination module, configured to determine the obstacle region in the initial grayscale image based on an adaptive threshold; a processing module, configured to optimize the obstacle region based on vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain a target grayscale image; a second conversion module, configured to convert the target grayscale image into a target occupied grid through the zero-copy conversion method, and to convert the pixel grayscale values of the target grayscale image into the target occupied probability of the target occupied grid through the pixel grayscale value mapping relationship; and a planning module, configured to plan the driving path of the vehicle based on the target occupied grid and the target occupied probability.
[0013] Furthermore, the vehicle path planning device also includes: a second acquisition module, used to acquire a baseline threshold, vehicle speed, sensor noise variance, and driving environment dynamic indicators, wherein the baseline threshold is used as the initial value for adjusting the adaptive threshold, the sensor noise variance is used to measure the degree of fluctuation of sensor data, and the driving environment dynamic indicators are used to measure the degree of transient change of the current driving environment; and a calculation module, used to obtain the adaptive threshold by weighted summation of the baseline threshold, vehicle speed, sensor noise variance, driving environment dynamic indicators, and the local probability gradient of the initial occupancy probability.
[0014] Furthermore, the first conversion module is also used to: determine the pixel gray value corresponding to the initial occupancy probability according to the mapping relationship between the initial occupancy probability and the pixel gray value; and convert the initial occupancy raster according to the pixel gray value and the zero-copy conversion method to obtain the initial grayscale image.
[0015] Furthermore, the determination module is also used to: divide the initial grayscale image into multiple regions based on pixel grayscale values; and, in response to any region having a pixel grayscale value greater than or equal to an adaptive threshold, determine the region having a pixel grayscale value greater than or equal to the adaptive threshold as an obstacle region.
[0016] Furthermore, the vehicle dynamic parameters include: vehicle width, vehicle speed, and turning radius. The processing module is also used to: determine the first obstacle boundary in the obstacle region based on a morphological operation kernel, wherein the size and shape of the morphological operation kernel are adjusted in real time based on the vehicle width, vehicle speed, and turning radius; determine multiple obstacle regions and the area of the obstacle regions based on the first obstacle boundary; remove regions with an area smaller than a first preset area threshold from the multiple obstacle regions to obtain the first obstacle region; filter the first obstacle region through a confidence-weighted filtering mechanism to retain the second obstacle region in the first obstacle region with a confidence level greater than a preset confidence threshold; further optimize the second obstacle region to obtain the target grayscale image.
[0017] Furthermore, the processing module is also used to: remove areas in the second obstacle region whose area is smaller than a second preset area threshold to obtain a third obstacle region, wherein the second preset area threshold is smaller than a first preset area threshold; extract the second obstacle boundary in the third obstacle region based on a morphological operation kernel; complete and correct the irregular boundaries and discontinuous boundaries in the second obstacle boundary based on a contour interpolation method to obtain the third obstacle boundary; determine a fourth obstacle region based on the third obstacle boundary; and determine the target grayscale image based on the fourth obstacle region and the non-obstacle region, wherein the pixel grayscale value of the non-obstacle region is smaller than an adaptive threshold.
[0018] Furthermore, the planning module is also used to: determine obstacle grids and non-obstacle grids in the target occupancy grid based on the target occupancy probability, wherein obstacle grids are used to represent grid cells with obstacles and non-obstacle grids are used to represent grid cells without obstacles; identify obstacle grids and non-obstacle grids to obtain drivable areas; and plan the vehicle's driving path based on the drivable areas.
[0019] According to another aspect of the embodiments of this application, a vehicle is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0020] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the methods in various embodiments of this application.
[0022] In this embodiment, firstly, an initial occupied grid and its corresponding initial occupied probability are obtained, where the initial occupied probability characterizes the probability that an obstacle exists in the initial occupied grid. Then, based on the initial occupied probability, pixel grayscale value mapping relationship, and zero-copy conversion method, the initial occupied grid is converted to a grayscale image to obtain an initial grayscale image. The zero-copy conversion method is used to convert between the occupied grid and the grayscale image based on the memory address mapping relationship. Next, an obstacle region in the initial grayscale image is determined based on an adaptive threshold. Then, the obstacle region is optimized based on vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain a target grayscale image. The target grayscale image is then converted to a target occupied grid using the zero-copy conversion method, and the pixel grayscale values of the target grayscale image are converted to the target occupied probability of the target occupied grid using the pixel grayscale value mapping relationship. Finally, the vehicle's driving path is planned based on the target occupied grid and the target occupied probability. By converting the occupied grid into a grayscale image and applying an adaptive image processing method, the real-time performance of post-grid processing is significantly improved while ensuring high accuracy. This results in a significant enhancement of the robustness and reliability of the autonomous driving system in obstacle detection, path planning, and decision-making processes, thereby solving the technical problem of low accuracy in obstacle identification in related technologies. Attached Figure Description
[0023] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0024] Figure 1 This is a flowchart of a vehicle routing method according to an embodiment of this application;
[0025] Figure 2 This is a schematic diagram of raster image conversion in a vehicle routing method according to an embodiment of this application;
[0026] Figure 3 This is a schematic diagram of a vehicle routing method according to an embodiment of this application;
[0027] Figure 4 This is a structural block diagram of a vehicle routing device according to an embodiment of this application. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] According to an embodiment of this application, a method embodiment for vehicle routing planning is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] This method embodiment can be executed in an electronic device or similar computing device that includes memory and a processor. Taking operation on a computer terminal as an example, the computer terminal may include one or more processors (processors may include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), digital signal processing (DSP) chips, microcontroller units (MCUs), field-programmable gate arrays (FPGAs), neural network processors (NPUs), tensor processors (TPUs), artificial intelligence (AI) type processors, etc.) and memory for storing data. Optionally, the computer terminal may also include transmission devices, input / output devices, and display devices for communication functions. Those skilled in the art will understand that the above structural description is merely illustrative and does not limit the structure of the computer terminal. For example, the computer terminal may include more or fewer components than described above, or have a different configuration than described above.
[0032] The memory can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the vehicle routing method in this embodiment. The processor executes various functional applications and data processing by running the computer program stored in the memory, thereby implementing the aforementioned vehicle routing method. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks (LANs), mobile communication networks, and combinations thereof.
[0033] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0034] Display devices can be, for example, touchscreen liquid crystal displays (LCDs) and touch displays (also referred to as "touchscreens" or "touch displays"). The LCD allows users to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), which allows users to interact with the GUI through finger contact and / or gestures on a touch-sensitive surface. Optional human-computer interaction functions include: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital video, playing digital music, and / or web browsing, etc. Executable instructions for performing the above human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.
[0035] This embodiment provides a vehicle route planning method. Figure 1 This is a flowchart of a vehicle routing method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:
[0036] Step S11: Obtain the initial occupied grid and the initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that there is an obstacle in the initial occupied grid;
[0037] Step S12: Based on the initial occupancy probability, pixel grayscale value mapping relationship and zero-copy conversion method, the initial occupied grid is converted into a grayscale image to obtain an initial grayscale image. The zero-copy conversion method is used to convert between the occupied grid and the grayscale image based on the memory address mapping relationship.
[0038] Step S13: Determine the obstacle region in the initial grayscale image based on the adaptive threshold;
[0039] Step S14: Based on vehicle dynamic parameters and confidence-weighted filtering mechanism, the obstacle area is optimized to obtain the target grayscale image;
[0040] Step S15: Convert the target grayscale image into a target occupancy grid through a zero-copy conversion method, and convert the pixel grayscale values of the target grayscale image into the target occupancy probability of the target occupancy grid through the pixel grayscale value mapping relationship;
[0041] Step S16: Plan the driving path of the vehicle based on the target occupancy grid and the target occupancy probability.
[0042] The above initial occupancy grid represents a two-dimensional or three-dimensional discrete grid in the autonomous driving perception system, which is used to record the possibility that each grid cell in the vehicle's surrounding environment is occupied by an obstacle. Each grid cell corresponds to an initial occupancy probability value.
[0043] The above initial occupancy probability represents the numerical value of the possibility that each grid cell has an obstacle in the initial occupancy grid. This probability value is obtained after preliminary processing of the data collected by on-vehicle sensors (such as lidar, camera). Specifically, let the initial occupancy probability be p(i, j), where 0 ≤ p(i, j) ≤ 1, 0 represents completely free, and 1 represents completely occupied.
[0044] The above pixel grayscale value mapping relationship represents the process of converting the initial occupancy probability value in the occupancy grid into the pixel grayscale value in the grayscale image. Specifically, the pixel grayscale value mapping relationship is implemented through the formula Gray(i, j) = floor(p(i, j) × 255), where p(i, j) is the initial occupancy probability value of the (i, j)-th grid in the occupancy grid, Gray(i, j) is the grayscale value of the corresponding pixel in the converted grayscale image, 0 ≤ Gray(i, j) ≤ 255, 0 represents the pixel grayscale value is black, 255 represents the pixel grayscale value is white, and the intermediate probability makes a linear transition. And the obstacle grid is mapped to a high grayscale value, the drivable area is mapped to a low grayscale value, and the unknown area is mapped to an intermediate grayscale value.
[0045] The above zero-copy conversion method represents an efficient data conversion mechanism, that is, by sharing memory or establishing a direct memory address mapping between the occupancy grid and the grayscale image, it avoids the data copying process from one data structure to another, directly converts the grid data into an image efficiently, and reduces data redundancy and latency.
[0046] Specifically, let the occupancy grid matrix be: G = {g(i, j)|0 ≤ i < H, 0 ≤ j < W}, where H and W are the height and width of the occupancy grid respectively, and g(i, j) represents the initial occupancy probability value of the (i, j)-th grid. Define the corresponding image matrix as: I = {I(i, j)|0 ≤ i < H, 0 ≤ j < W}, and the zero-copy mapping relationship is: I(i, j) ≡ f(g(i, j)) = floor(g(i, j) × 255), where f( Let G(i,j) be the linear mapping function from probability to grayscale. The symbol “≡” indicates that both share the same memory address and no data copying occurs. Therefore, the raster matrix and the image matrix satisfy: Addr(I(i,j))=Addr(G(i,j)), meaning that they differ only in their interpretation (probability value / grayscale value) while having the same physical storage space, thus achieving zero-copy conversion.
[0047] The aforementioned initial grayscale image represents grayscale image format data directly converted from the initial occupied grid. The conversion process is based on the mapping relationship between probability values and grayscale values, where the initial occupancy probability of each grid cell in the initial occupied grid is converted into the corresponding pixel grayscale value in the grayscale image. Furthermore, the initial grayscale image retains information about the obstacle distribution in the original occupied grid, but it contains noise, boundary discontinuities, and other non-ideal characteristics, requiring further processing.
[0048] The aforementioned adaptive threshold represents a value that can be dynamically adjusted based on factors such as vehicle driving status, ambient lighting conditions, and sensor noise characteristics. Compared to a fixed threshold, it can more accurately distinguish between obstacles and free space. In image processing, the adaptive threshold can automatically determine the binarization or multi-value standard based on local features (such as brightness variations and texture density) to enhance the robustness and accuracy of obstacle boundary recognition.
[0049] The aforementioned vehicle dynamic parameters include, but are not limited to, vehicle speed, turning radius, and vehicle width, which are used to describe the current motion state of the vehicle. In obstacle recognition and path planning, vehicle dynamic parameters help optimize recognition and planning decisions.
[0050] The confidence-weighted filtering mechanism described above represents a noise suppression technique that adjusts the filtering intensity based on the confidence level of each grid cell (i.e., the confidence level of the sensor's observation of that grid cell). For high-confidence regions, boundary integrity is maintained, while for low-confidence regions, smoothing is performed to remove noise points. This mechanism effectively balances boundary accuracy and noise resistance, improving the continuity and stability of obstacle contours.
[0051] The aforementioned target grayscale image represents grayscale image format data after optimization processing. Optimization processing includes, but is not limited to, dynamic dilation / erosion, noise removal, small obstacle filtering, contour extraction, and boundary correction. Through these operations, obstacle regions in the target grayscale image are enhanced and optimized, boundaries are more continuous and clearer, noise points are effectively suppressed, and the overall image quality is significantly improved, making it suitable as input for subsequent path planning and decision-making modules.
[0052] The aforementioned target occupancy grid represents the occupancy grid optimized through all processing steps in this application embodiment. It contains the latest environmental information, and each grid cell represents the probability that the area is occupied by an obstacle in probabilistic form. The target occupancy grid contains accurate, continuous, and high-confidence information on obstacles and drivable areas to facilitate final path planning and decision-making.
[0053] The target occupancy probability mentioned above represents the updated probability value in the target occupancy grid, used to accurately describe the likelihood of each grid cell being occupied by an obstacle. The updated target occupancy probability undergoes a series of adaptive optimizations, improving the accuracy and reliability of path planning.
[0054] In the process of converting the target grayscale image into a target occupancy grid, this embodiment employs a zero-copy conversion method, directly referencing the data in the target grayscale image as the format of the target occupancy grid. This avoids repeated copying of data during transmission between the image and the grid, significantly reducing computational resource consumption and improving data conversion speed and system response time. After completing the zero-copy conversion from the target grayscale image to the target occupancy grid, this embodiment further utilizes a predefined pixel grayscale value mapping relationship to convert the grayscale value of each pixel in the target grayscale image into the target occupancy probability of the corresponding grid cell in the target occupancy grid. This conversion process directly reflects the probability that the area is occupied by an obstacle based on the pixel grayscale value, thus enabling the target occupancy grid to provide obstacle information in probabilistic form, providing direct and accurate data support for subsequent path planning.
[0055] After obtaining the target occupancy grid and the target occupancy probability, the vehicle's driving path can be planned. This process relies on the adaptively processed target occupancy probability to ensure that the existence of obstacles is fully considered during path planning, thereby providing the vehicle with a safe and efficient driving path.
[0056] Based on steps S11 to S16 above, firstly, the initial occupied grid and its corresponding initial occupied probability are obtained, where the initial occupied probability represents the probability that an obstacle exists in the initial occupied grid; then, based on the initial occupied probability, pixel grayscale value mapping relationship, and zero-copy conversion method, the initial occupied grid is converted to a grayscale image to obtain an initial grayscale image, where the zero-copy conversion method is used to convert between the occupied grid and the grayscale image based on the memory address mapping relationship; then, the obstacle region in the initial grayscale image is determined based on an adaptive threshold; next, the obstacle region is optimized based on vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain a target grayscale image; then, the target grayscale image is converted to a target occupied grid using the zero-copy conversion method, and the pixel grayscale values of the target grayscale image are converted to the target occupied probability of the target occupied grid using the pixel grayscale value mapping relationship; finally, the vehicle's driving path is planned based on the target occupied grid and the target occupied probability. This application embodiment achieves the goal of significantly improving the real-time performance of post-grid processing while ensuring high accuracy by converting the occupied grid into a grayscale image and applying an adaptive image processing method. This results in a significant enhancement of the robustness and reliability of the autonomous driving system in obstacle detection, path planning and decision-making processes, thereby solving the technical problem of low accuracy in obstacle identification in related technologies.
[0057] Optionally, the vehicle path planning method in this application embodiment further includes: obtaining a baseline threshold, vehicle speed, sensor noise variance, and driving environment dynamic indicators, wherein the baseline threshold is used as the initial value for adjusting the adaptive threshold, the sensor noise variance is used to measure the degree of fluctuation of sensor data, and the driving environment dynamic indicators are used to measure the degree of transient change of the current driving environment; and the adaptive threshold is obtained by weighted summation of the baseline threshold, vehicle speed, sensor noise variance, driving environment dynamic indicators, and the local probability gradient of the initial occupancy probability.
[0058] The aforementioned baseline threshold represents the initial reference value for binarization processing when the initial occupied raster is converted into the initial grayscale image, defining the basic boundary for the mapping from probability values to grayscale values. By setting a reasonable baseline value and adjusting it in conjunction with other dynamic parameters, the embodiments of this application can achieve adaptive optimization for complex driving scenarios.
[0059] The vehicle speed mentioned above is one of the important parameters reflecting the current driving state of an autonomous vehicle. In this embodiment, vehicle speed is used to adjust the size of the adaptive threshold to adapt to the obstacle detection sensitivity requirements at different driving speeds. For example, at high speeds, a larger adaptive threshold can be set to reduce false alarms and ignore small fluctuations in sensor measurements; at low speeds, a smaller adaptive threshold can be used to capture more details of potential obstacles. Adjusting the threshold based on vehicle speed improves the dynamic adaptability and intelligence of this embodiment.
[0060] The aforementioned sensor noise variance represents a statistical measure quantifying the degree of fluctuation in sensor data, used to evaluate the reliability and stability of sensor output. In this embodiment, the sensor noise variance is used as a weighting factor in the calculation of the adaptive threshold, aiming to reduce the false recognition rate by increasing the threshold in noisy environments and to decrease the threshold in low-noise environments for more precise obstacle identification. Dynamically adjusting the processing strategy based on different sensor performance improves the robustness and versatility of the overall processing flow.
[0061] The aforementioned dynamic driving environment indicators represent quantitative metrics that comprehensively assess the degree of transient changes in the driving environment, such as traffic flow, weather conditions, and road surface conditions. In this application's embodiments, by introducing dynamic driving environment indicators during adaptive threshold adjustment, the impact of the environment on the initial occupancy grid processing can be reflected, ensuring the flexibility and environmental adaptability of the initial occupancy grid processing. For example, in highly dynamic environments (such as busy streets or rainy / foggy weather), the adaptive threshold may be increased to avoid frequent false alarms; while in static or clear environments, the threshold will be correspondingly decreased to capture obstacle information more precisely.
[0062] The aforementioned local probability gradient of the initial occupancy probability represents the rate of change of the probability value near the obstacle boundary in the initial occupancy grid. By introducing the local probability gradient during adaptive threshold adjustment, this embodiment of the application can enhance the detection sensitivity of the obstacle boundary region while avoiding overprocessing of the internal region.
[0063] After obtaining the baseline threshold, vehicle speed, sensor noise variance, dynamic indicators of the driving environment, and the local probability gradient of the initial occupancy probability, the adaptive threshold can be obtained by weighted summation of the above data. The weighted summation formula is: Adaptive threshold T(i,j) = +α·v+β·σ+γ·E+δ·Δp(i,j), where α is the baseline threshold, v is the vehicle speed, reflecting the influence of motion on the threshold, σ is the sensor noise variance, used to dynamically suppress misjudgments in high-noise environments, E is a dynamic indicator of the driving environment, such as the speed of obstacles ahead or the rate of change of the scene, Δp(i,j) is the local probability gradient, used to enhance the sensitivity of the boundary region, and α, β, γ, δ are adjustable weight parameters.
[0064] Based on the above optional embodiments, by comprehensively considering the local probability gradient and the benchmark threshold, vehicle speed, sensor noise variance, driving environment dynamic indicators, and the local probability gradient of the initial occupancy probability, the embodiments of this application can adaptively generate a suitable threshold for the current position and environmental conditions, so as to effectively suppress static and dynamic noise, reduce false recognition, and thus improve the overall accuracy and efficiency of obstacle recognition.
[0065] Optionally, in step S12, the initial occupied grid is converted to grayscale based on the initial occupancy probability, the pixel grayscale value mapping relationship, and the zero-copy conversion method to obtain an initial grayscale image, including: determining the pixel grayscale value corresponding to the initial occupancy probability according to the initial occupancy probability and the pixel grayscale value mapping relationship; and converting the initial occupied grid according to the pixel grayscale value and the zero-copy conversion method to obtain the initial grayscale image.
[0066] The above process determines the pixel gray value representation corresponding to the initial occupancy probability based on the mapping relationship between the initial occupancy probability and the pixel gray value. According to the pixel gray value mapping formula Gray(i,j)=floor(p(i,j)×255), the initial occupancy probability p(i,j) is mapped to the corresponding pixel gray value Gray(i,j). That is, the probability value range [0,1] is mapped to the gray value range [0,255], and the probability representation of the initial occupancy grid is converted into the visual representation of the gray value image.
[0067] When converting the initial occupied raster based on pixel grayscale values and a zero-copy conversion method, this embodiment directly references the initial occupied raster data structure as the initial grayscale image data structure in memory, and uses a linear mapping function f( The initial grayscale image is obtained.
[0068] Based on the above optional embodiments, by performing grayscale image conversion based on initial occupancy probability, pixel grayscale value mapping relationship and zero-copy conversion method, the embodiments of this application can quickly convert the initial occupancy grid data into intuitive image information, namely the initial grayscale image, which greatly improves the efficiency and real-time performance of data processing, while maintaining the integrity and accuracy of obstacle information.
[0069] For example, Figure 2 This is a schematic diagram of raster image conversion in a vehicle routing method according to an embodiment of this application, as shown below. Figure 2As shown, firstly, sensor data in the vehicle coordinate system is projected onto the grid coordinate system. That is, based on the vehicle's current position, orientation, and sensor data, the relative positions of each obstacle within the occupancy grid are determined. This conversion from the vehicle coordinate system to the grid coordinate system involves coordinate transformation, rotation, and translation to ensure that the grid data accurately reflects the obstacle distribution in the vehicle's surrounding environment. When converting from the grid coordinate system to the image coordinate system, this embodiment maps the occupancy grid data to a grayscale image. Specifically, the occupancy probability p(i,j) of each grid cell is mapped to a grayscale value Gray(i,j). For example, p(i,j)=0 (free space) is mapped to Gray(i,j)=255 (white), p(i,j)=1 (obstacle) is mapped to Gray(i,j)=0 (black), and intermediate probabilities are linearly mapped to the interval [0, 255]. Simultaneously, a direct relationship is established between the coordinate positions (x, y) in the grid coordinate system and the coordinates (i, j) in the image coordinate system. Because of the zero-copy mechanism, this mapping process does not require copying data; it only needs to be implemented by changing the interpretation method, greatly improving the efficiency of data processing. When returning from the image coordinate system to the raster coordinate system, this embodiment maps the optimized target grayscale image back to the occupancy grid format. Each pixel in the image coordinate system is inversely mapped, converting it back to the occupancy probability in the raster coordinate system. For example, a grayscale value Gray(i,j)=255 corresponds to an occupancy probability p(i,j)=0, Gray(i,j)=0 corresponds to p(i,j)=1, and other grayscale values are inversely mapped to their corresponding probability values in the range [0,1]. Through inverse mapping, not only is the original structure of the occupancy grid restored, but also, due to optimization in the image processing stage, the obstacle information in the occupancy grid becomes more accurate, the boundaries are more continuous, and noise points are effectively suppressed. By establishing the transformation relationship between vehicle coordinate system and grid coordinates, and between grid coordinates and image coordinates, the embodiments of this application can optimize the occupancy grid data in the image domain using efficient image processing algorithms, and then convert the optimization results back to the occupancy grid format, providing a novel and efficient data processing method for autonomous driving systems, significantly improving the real-time performance and accuracy of occupancy grid obstacle information, and facilitating subsequent path planning and decision-making.
[0070] Optionally, in step S13, determining the obstacle region in the initial grayscale image based on the adaptive threshold includes: dividing the initial grayscale image into multiple regions based on pixel grayscale values; and determining the region whose pixel grayscale value is greater than or equal to the adaptive threshold as the obstacle region in response to any region having a pixel grayscale value greater than or equal to the adaptive threshold.
[0071] The above-described division of the initial grayscale image into multiple regions based on pixel grayscale values represents preliminary preprocessing of the initial grayscale image. By analyzing the distribution of different grayscale values in the image, the image is segmented into multiple regions, each with the same grayscale value attribute, to facilitate subsequent dynamic obstacle detection. The distribution of pixel grayscale values can reflect information about obstacles, drivable areas, and undetermined areas in the image. Reasonable region division helps in subsequent accurate identification and processing.
[0072] The obstacle region mentioned above represents the spatial area in the initial grayscale image where potential obstacles are identified after adaptive threshold filtering. This obstacle region consists of pixels in the initial grayscale image whose grayscale values are greater than or equal to the adaptive threshold, representing the location information of potential obstacles.
[0073] The above method, when identifying an obstacle region, compares the pixel grayscale value of each region with an adaptive threshold to identify areas most likely to be occupied by obstacles. Specifically, if the pixel grayscale value of a certain region is greater than or equal to the adaptive threshold, then that region is identified as an obstacle region. This process ensures that a region is only identified as an obstacle region when its initial grayscale value reaches or exceeds the adaptive threshold, thus avoiding overly aggressive or conservative detection results caused by a fixed threshold, and improving the accuracy and environmental adaptability of obstacle recognition.
[0074] Based on the above optional embodiments, by determining the obstacle region of the initial grayscale image based on an adaptive threshold, the embodiments of this application can effectively identify and filter obstacles in the autonomous driving-occupied grid. The introduction of the adaptive threshold ensures that the algorithm can intelligently respond to the obstacle detection needs under different driving conditions, avoiding the limitations of a single fixed threshold in complex environments. The accurate determination of the obstacle region provides a clear target for subsequent image processing steps, enhancing the boundary continuity and noise suppression capability of the occupied grid.
[0075] Optionally, the vehicle dynamic parameters include: vehicle width, vehicle speed, and turning radius. In step S14, the obstacle region is optimized based on the vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain a target grayscale image. This includes: determining the first obstacle boundary in the obstacle region based on a morphological operation kernel, wherein the size and shape of the morphological operation kernel are adjusted in real time based on the vehicle width, vehicle speed, and turning radius; determining multiple obstacle regions and their areas based on the first obstacle boundary; removing regions with areas smaller than a first preset area threshold from the multiple obstacle regions to obtain the first obstacle region; filtering the first obstacle region using a confidence-weighted filtering mechanism to retain the second obstacle region in the first obstacle region with a confidence level greater than a preset confidence threshold; and further optimizing the second obstacle region to obtain the target grayscale image.
[0076] The aforementioned morphological operation kernel can be a kernel function used in image processing for dilation and erosion operations to change the shape and size of obstacle regions in an image. In the embodiments of this application, the size and shape of the morphological operation kernel are adjusted in real time based on vehicle dynamic parameters to adapt to different vehicle sizes and driving states. For example, when the vehicle speed is high, the morphological operation kernel increases to filter out high-frequency noise that may be generated by the sensor during high-speed driving; when the turning radius decreases, the morphological operation kernel tends to be elliptical to enhance the integrity of obstacle boundaries in turning scenarios; when the vehicle width increases, the morphological operation kernel is enlarged proportionally to ensure applicability to different vehicle models. The adaptive characteristics of the aforementioned morphological operation kernel enable morphological processing to more accurately identify and optimize obstacle boundaries, improving the overall effect of grid-based obstacle processing.
[0077] The aforementioned first obstacle boundary refers to the obstacle region boundary obtained after processing by the morphological operation kernel, reflecting the shape, position, and area of the obstacle after preliminary optimization. By adjusting the size and shape of the morphological operation kernel, the first obstacle boundary can more accurately depict the actual outline of the obstacle, facilitating subsequent confidence-weighted filtering and area threshold screening.
[0078] The aforementioned first preset area threshold can be an area standard used to determine the authenticity and importance of obstacle areas. The selection of the first preset area threshold needs to comprehensively consider factors such as vehicle size, driving environment, and safety requirements to ensure that neither real small obstacles are missed nor all small-area interferences are considered, thus maintaining the efficiency and accuracy of path planning. In this embodiment, obstacle areas with an area smaller than the first preset area threshold are considered false alarms or irrelevant noise points and will be removed to reduce interference from irrelevant information.
[0079] The aforementioned first obstacle region refers to the obstacle region whose area is greater than a first preset area threshold after the first obstacle boundary is determined based on the morphological operation kernel. This first obstacle region has been preliminarily screened, eliminating regions that are too small or may be false alarms caused by sensor noise, facilitating subsequent adaptive optimization processing.
[0080] The aforementioned preset confidence threshold can be pre-set when filtering the first obstacle region using a confidence-weighted filtering mechanism. This threshold filters obstacle regions with low confidence, ensuring that the ultimately retained obstacle information has sufficient reliability and accuracy. The preset confidence threshold is set based on the confidence level of the sensor data. Obstacle regions above this threshold are considered real and will be retained; regions below the threshold may be considered uncertain or false alarms and will be excluded. In this embodiment, regions within the first obstacle region with a confidence level greater than the preset confidence threshold are retained as the second obstacle region to improve recognition accuracy.
[0081] The second obstacle region mentioned above represents the obstacle region with higher confidence that was retained after being filtered by a confidence-weighted filtering mechanism. Compared to the first obstacle region, the second obstacle region has undergone further confidence verification and is more representative of the actual obstacle distribution, providing a more accurate basis for subsequent optimization processing.
[0082] Based on the above optional embodiments, the embodiments of this application can dynamically adjust the morphological operation kernel, accurately identify and optimize obstacle boundaries, and avoid the limitations of a fixed kernel size in different scenarios. Furthermore, the embodiments of this application significantly reduce the false recognition rate caused by sensor noise or environmental interference by eliminating obstacle areas that are too small or have low confidence levels, further improving the accuracy, robustness, and real-time performance of grid obstacle detection, and ensuring the safe operation of the autonomous driving system.
[0083] Optionally, in step S14, the second obstacle region is further optimized to obtain a target grayscale image, including: removing regions in the second obstacle region whose area is smaller than a second preset area threshold to obtain a third obstacle region, wherein the second preset area threshold is smaller than a first preset area threshold; extracting the boundary of the second obstacle region in the third obstacle region based on a morphological operation kernel; completing and correcting the irregular and discontinuous boundaries in the boundary of the second obstacle region based on a contour interpolation method to obtain the boundary of the third obstacle region; determining a fourth obstacle region based on the boundary of the third obstacle region; and determining the target grayscale image based on the fourth obstacle region and the non-obstacle region, wherein the pixel grayscale value of the non-obstacle region is smaller than an adaptive threshold.
[0084] The aforementioned second preset area threshold can be a lower area standard than the first preset area threshold, used to retain obstacle regions with smaller areas but higher confidence levels, in order to capture more refined obstacle information. By setting the second preset area threshold, the embodiments of this application can cover a wider range of obstacle categories while ensuring recognition accuracy, thereby improving the comprehensiveness and detail of grid obstacle processing.
[0085] The aforementioned third obstacle region refers to the further simplified obstacle region obtained by eliminating the second obstacle region whose area is smaller than the second preset area threshold.
[0086] The third obstacle boundary mentioned above represents the obstacle boundary after completion and correction using contour interpolation, aiming to improve boundary continuity and regularity. Through interpolation and correction, the irregularity and discontinuity problems existing in the second obstacle boundary are resolved, ensuring a reliable representation of the area surrounding the obstacle and facilitating the subsequent determination of the fourth obstacle area and the target grayscale image.
[0087] The aforementioned fourth obstacle region represents the final set of obstacle regions confirmed after a series of optimization and technical processing steps. The fourth obstacle region is obtained by combining the third obstacle region determined based on the first obstacle boundary with morphological operation kernels and contour interpolation to obtain the second and third obstacle boundaries, thus arriving at the final set of obstacle regions. The fourth obstacle region integrates the results of all previous processing steps, including but not limited to area threshold filtering, confidence-weighted filtering, boundary morphological operations, and contour interpolation correction, ensuring the accuracy, continuity, and regularity of the identified obstacles.
[0088] The aforementioned target grayscale image represents the most accurate and complete representation of the obstacle region obtained through comparative analysis between the fourth obstacle region and the non-obstacle region, as well as further algorithmic filtering and verification. It includes optimized obstacle region information, and both the obstacle region and the non-obstacle region are clearly distinguished in the form of pixel grayscale values.
[0089] Based on the above optional embodiments, in the optimization process of the second obstacle region, this application first eliminates areas with an area lower than a second preset area threshold, generating a third obstacle region to ensure that even subtle obstacle information is not overlooked. Subsequently, based on the third obstacle region, the boundary of the second obstacle is determined using a morphological operation kernel, and then contour interpolation is used to complete and correct the boundary, generating a more continuous and regular third obstacle boundary. This effectively solves the problems of boundary discontinuity and irregularity, improving the accuracy and completeness of the obstacle boundary. Finally, a more refined obstacle region is determined through the third obstacle boundary, and combined with the pixel grayscale values of non-obstacle regions, a target grayscale image is generated, achieving depth optimization and accurate representation of the obstacle region occupying the grid. This application embodiment significantly improves the completeness and accuracy of obstacle information in the grid through depth optimization processing of the obstacle region.
[0090] Optionally, in step S16, the vehicle's driving path is planned based on the target occupied grid and the target occupied probability, including: determining obstacle grids and non-obstacle grids in the target occupied grid based on the target occupied probability, wherein obstacle grids are used to represent grid cells with obstacles and non-obstacle grids are used to represent grid cells without obstacles; identifying obstacle grids and non-obstacle grids to obtain a drivable area; and planning the vehicle's driving path based on the drivable area.
[0091] The aforementioned target occupancy grid contains accurate and continuous information on obstacles and drivable areas. The target occupancy probability quantifies the likelihood of an obstacle within each grid cell, distinguishing whether a grid cell contains an obstacle and forming the basis for classifying obstacle and non-obstacle grids. The obstacle grid represents a grid cell whose target occupancy probability exceeds a certain threshold and is therefore considered to contain an obstacle; it directly marks areas that should not be entered in the driving environment. The non-obstacle grid represents a grid cell whose target occupancy probability does not exceed the threshold, is considered to contain no obstacles, and is safe to pass through; it accurately defines the vehicle's feasible driving space and provides usable area information for path planning.
[0092] The aforementioned drivable area refers to the region composed of non-obstacle grids, that is, the spatial area deemed safe for vehicles to pass through. This application's embodiments, through effective identification of obstacle and non-obstacle grids, can clearly define the safe drivable area in the vehicle's surrounding environment, ensuring that the vehicle can avoid obstacles and select the optimal driving path. The aforementioned identification process may involve connected component analysis, edge detection, or other image processing techniques.
[0093] After determining the feasible area, embodiments of this application utilize advanced path planning algorithms, such as A. Algorithms such as A-Star, Rapidly-exploring Random Trees (RRT), or graph theory are used to calculate the optimal path from the vehicle's current location to its destination. During path planning, the algorithm fully considers the positions of obstacle grids to avoid all marked obstacle areas while searching for the shortest and safest path. Path planning not only considers path length but also evaluates path feasibility, avoiding overly narrow or complex routes to ensure the vehicle reaches its destination smoothly and safely.
[0094] Based on the above optional embodiments, the embodiments of this application determine the drivable area based on the target occupancy grid and the target occupancy probability, and then perform driving path planning based on the drivable area, which significantly improves the accuracy of the autonomous driving system in obstacle detection and path planning, and provides the vehicle with more reliable and intelligent navigation services. Especially in high dynamic and high resolution occupancy grid environments, it can effectively deal with problems such as noise and boundary continuity, and ensure the robustness and real-time performance of path planning.
[0095] Figure 3 This is a schematic diagram of a vehicle routing method according to an embodiment of this application, such as... Figure 3 As shown, autonomous driving sensor data generates a primary occupancy grid, which serves as input for the vehicle path planning method. The primary occupancy grid includes visual occupancy grids, laser occupancy grids, and ultrasonic point cloud data. In the raster-to-image module, the initial occupancy grid is converted into an initial grayscale image using initial occupancy probability, pixel grayscale value mapping, and a zero-copy conversion method. During the conversion, obstacle grids are assigned high grayscale values, drivable areas correspond to low grayscale values, and unknown areas lie in between, facilitating subsequent image processing analysis and optimization. In the graphics processing module, the initial grayscale image undergoes a series of image processing operations, such as dynamic morphological operations, noise point removal, small obstacle filtering, contour extraction, and boundary correction, to obtain the target grayscale image. This aims to improve the accuracy and robustness of obstacle recognition while reducing the impact of noise on the accuracy of the raster data. In the image-to-raster module, the processed target grayscale image is again converted back to the target occupancy grid format using a zero-copy conversion method. However, this target occupancy grid has been optimized, possessing higher accuracy and more continuous obstacle boundaries. The optimized target occupancy grid significantly improves data quality, helping autonomous vehicles to identify obstacles and drivable areas more quickly and accurately, thereby developing and outputting safe driving paths.
[0096] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0097] According to an embodiment of this application, an apparatus embodiment for a vehicle routing method is provided. Figure 4 This is a structural block diagram of a vehicle routing device according to an embodiment of this application, such as... Figure 4 As shown, the device can be used to execute the above-mentioned vehicle path planning method. The vehicle path planning device 400 includes: a first acquisition module 401, used to acquire an initial occupied grid and the initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that there is an obstacle in the initial occupied grid; and a first conversion module 402, used to perform grayscale image conversion on the initial occupied grid based on the initial occupied probability, pixel grayscale value mapping relationship and zero-copy conversion method to obtain an initial grayscale image, wherein the zero-copy conversion method is used to perform mutual conversion between the occupied grid and the grayscale image based on the memory address mapping relationship. The system comprises: a determination module 403, used to determine the obstacle region in the initial grayscale image based on an adaptive threshold; a processing module 404, used to optimize the obstacle region based on vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain the target grayscale image; a second conversion module 405, used to convert the target grayscale image into a target occupancy grid using a zero-copy conversion method, and to convert the pixel grayscale values of the target grayscale image into the target occupancy probability of the target occupancy grid using a pixel grayscale value mapping relationship; and a planning module 406, used to plan the vehicle's driving path based on the target occupancy grid and the target occupancy probability.
[0098] Furthermore, the vehicle path planning device 400 also includes: a second acquisition module, used to acquire a baseline threshold, vehicle speed, sensor noise variance, and driving environment dynamic indicators, wherein the baseline threshold is used as the initial value for adjusting the adaptive threshold, the sensor noise variance is used to measure the degree of fluctuation of sensor data, and the driving environment dynamic indicators are used to measure the degree of transient change of the current driving environment; and a calculation module, used to obtain the adaptive threshold by weighted summation of the baseline threshold, vehicle speed, sensor noise variance, driving environment dynamic indicators, and the local probability gradient of the initial occupancy probability.
[0099] Furthermore, the first conversion module 402 is also used to: determine the pixel gray value corresponding to the initial occupancy probability according to the mapping relationship between the initial occupancy probability and the pixel gray value; and convert the initial occupancy raster according to the pixel gray value and the zero-copy conversion method to obtain the initial grayscale image.
[0100] Furthermore, the determining module 403 is also used to: divide the initial grayscale image into multiple regions based on pixel grayscale values; and, in response to any region having a pixel grayscale value greater than or equal to an adaptive threshold, determine the region having a pixel grayscale value greater than or equal to the adaptive threshold as an obstacle region.
[0101] Furthermore, the vehicle dynamic parameters include: vehicle width, vehicle speed, and turning radius. The processing module 404 is also used to: determine the first obstacle boundary in the obstacle region based on the morphological operation kernel, wherein the size and shape of the morphological operation kernel are adjusted in real time based on the vehicle width, vehicle speed, and turning radius; determine multiple obstacle regions and the area of the obstacle regions based on the first obstacle boundary; remove regions in the multiple obstacle regions whose area is smaller than a first preset area threshold to obtain the first obstacle region; filter the first obstacle region through a confidence weighted filtering mechanism to retain the second obstacle region in the first obstacle region whose confidence is greater than a preset confidence threshold; further optimize the second obstacle region to obtain the target grayscale image.
[0102] Furthermore, the processing module 404 is also used to: remove areas in the second obstacle region whose area is smaller than a second preset area threshold to obtain a third obstacle region, wherein the second preset area threshold is smaller than a first preset area threshold; extract the second obstacle boundary in the third obstacle region based on a morphological operation kernel; complete and correct the irregular boundaries and discontinuous boundaries in the second obstacle boundary based on a contour interpolation method to obtain the third obstacle boundary; determine a fourth obstacle region based on the third obstacle boundary; and determine a target grayscale image based on the fourth obstacle region and non-obstacle regions, wherein the pixel grayscale value of the non-obstacle region is smaller than an adaptive threshold.
[0103] Furthermore, the planning module 406 is also used to: determine obstacle grids and non-obstacle grids in the target occupancy grid based on the target occupancy probability, wherein obstacle grids are used to represent grid cells with obstacles and non-obstacle grids are used to represent grid cells without obstacles; identify obstacle grids and non-obstacle grids to obtain drivable areas; and plan the vehicle's driving path based on the drivable areas.
[0104] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0105] Embodiments of this application also provide a vehicle, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods described in various embodiments of this application when it runs.
[0106] Optionally, in this embodiment, the vehicle can be configured to perform the following steps via a computer program:
[0107] S11, obtain the initial occupied grid and the initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that there is an obstacle in the initial occupied grid;
[0108] S12, the initial occupied raster is converted to grayscale image based on the initial occupancy probability, pixel grayscale value mapping relationship and zero-copy conversion method to obtain the initial grayscale image. The zero-copy conversion method is used to convert between the occupied raster and the grayscale image based on the memory address mapping relationship.
[0109] S13, Determine the obstacle region in the initial grayscale image based on an adaptive threshold;
[0110] S14, Based on vehicle dynamic parameters and confidence weighted filtering mechanism, the obstacle area is optimized to obtain the target grayscale image;
[0111] S15, convert the target grayscale image into a target-occupying grid using a zero-copy conversion method, and convert the pixel grayscale values of the target grayscale image into the target occupancy probability of the target-occupying grid using a pixel grayscale value mapping relationship;
[0112] S16, plan the vehicle's driving path based on the target occupancy grid and the target occupancy probability.
[0113] Embodiments of this application also provide a computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0114] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0115] S11, obtain the initial occupied grid and the initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that there is an obstacle in the initial occupied grid;
[0116] S12, the initial occupied raster is converted to grayscale image based on the initial occupancy probability, pixel grayscale value mapping relationship and zero-copy conversion method to obtain the initial grayscale image. The zero-copy conversion method is used to convert between the occupied raster and the grayscale image based on the memory address mapping relationship.
[0117] S13, Determine the obstacle region in the initial grayscale image based on an adaptive threshold;
[0118] S14, Based on vehicle dynamic parameters and confidence weighted filtering mechanism, the obstacle area is optimized to obtain the target grayscale image;
[0119] S15, convert the target grayscale image into a target-occupying grid using a zero-copy conversion method, and convert the pixel grayscale values of the target grayscale image into the target occupancy probability of the target-occupying grid using a pixel grayscale value mapping relationship;
[0120] S16, plan the vehicle's driving path based on the target occupancy grid and the target occupancy probability.
[0121] Embodiments of this application also provide an electronic device, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0122] Optionally, in this embodiment, the electronic device can be configured to perform the following steps via a computer program:
[0123] S11, obtain the initial occupied grid and the initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that there is an obstacle in the initial occupied grid;
[0124] S12, the initial occupied raster is converted to grayscale image based on the initial occupancy probability, pixel grayscale value mapping relationship and zero-copy conversion method to obtain the initial grayscale image. The zero-copy conversion method is used to convert between the occupied raster and the grayscale image based on the memory address mapping relationship.
[0125] S13, Determine the obstacle region in the initial grayscale image based on an adaptive threshold;
[0126] S14, Based on vehicle dynamic parameters and confidence weighted filtering mechanism, the obstacle area is optimized to obtain the target grayscale image;
[0127] S15, convert the target grayscale image into a target-occupying grid using a zero-copy conversion method, and convert the pixel grayscale values of the target grayscale image into the target occupancy probability of the target-occupying grid using a pixel grayscale value mapping relationship;
[0128] S16, plan the vehicle's driving path based on the target occupancy grid and the target occupancy probability.
[0129] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0133] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, optical disks, and other media capable of storing program code.
[0134] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A vehicle route planning method, characterized in that, include: Obtain the initial occupied grid and the initial occupied probability corresponding to the initial occupied grid, wherein the initial occupied probability is used to characterize the probability that there is an obstacle in the initial occupied grid; Based on the initial occupancy probability, pixel grayscale value mapping relationship, and zero-copy conversion method, the initial occupied grid is converted into a grayscale image to obtain an initial grayscale image. The zero-copy conversion method is used to convert between the occupied grid and the grayscale image based on the memory address mapping relationship. The obstacle region in the initial grayscale image is determined based on an adaptive threshold. The obstacle region is optimized based on vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain a target grayscale image; The zero-copy conversion method converts the target grayscale image into a target-occupying grid, and the pixel grayscale values of the target grayscale image are converted into the target occupancy probability of the target-occupying grid through the pixel grayscale value mapping relationship. The vehicle's driving path is planned based on the target occupancy grid and the target occupancy probability.
2. The method according to claim 1, characterized in that, The method further includes: The system acquires a baseline threshold, vehicle speed, sensor noise variance, and dynamic indicators of the driving environment. The baseline threshold is used as the initial value for adjusting the adaptive threshold, the sensor noise variance is used to measure the degree of fluctuation of sensor data, and the dynamic indicators of the driving environment are used to measure the degree of transient change of the current driving environment. The adaptive threshold is obtained by weighted summation of the baseline threshold, the vehicle speed, the sensor noise variance, the driving environment dynamic index, and the local probability gradient of the initial occupancy probability.
3. The method according to claim 1, characterized in that, The step of converting the initially occupied raster to grayscale based on the initial occupancy probability, pixel grayscale value mapping relationship, and zero-copy conversion method to obtain an initial grayscale image includes: The pixel grayscale value corresponding to the initial occupancy probability is determined based on the mapping relationship between the initial occupancy probability and the pixel grayscale value. The initial occupied grid is converted according to the pixel grayscale value and the zero-copy conversion method to obtain the initial grayscale image.
4. The method according to claim 3, characterized in that, The step of determining the obstacle region in the initial grayscale image based on an adaptive threshold includes: The initial grayscale image is divided into multiple regions based on the pixel grayscale values; In response to any region having a pixel grayscale value greater than or equal to the adaptive threshold, the region having a pixel grayscale value greater than or equal to the adaptive threshold is determined as the obstacle region.
5. The method according to claim 4, characterized in that, The vehicle dynamic parameters include: vehicle width, vehicle speed, and turning radius. The optimization processing of the obstacle region based on the vehicle dynamic parameters and a confidence-weighted filtering mechanism to obtain the target grayscale image includes: The first obstacle boundary in the obstacle region is determined based on a morphological manipulation kernel, wherein the size and shape of the morphological manipulation kernel are adjusted in real time based on the vehicle width, the vehicle speed, and the turning radius; Based on the first obstacle boundary, a plurality of obstacle regions and the area of the obstacle regions are determined; By removing regions from the multiple obstacle regions whose area is smaller than a first preset area threshold, a first obstacle region is obtained; The first obstacle region is filtered by the confidence weighted filtering mechanism, and the second obstacle region in the first obstacle region with a confidence level greater than a preset confidence threshold is retained. The second obstacle region is further optimized to obtain the target grayscale image.
6. The method according to claim 5, characterized in that, The further optimization processing of the second obstacle region to obtain the target grayscale image includes: By removing areas in the second obstacle region whose area is smaller than a second preset area threshold, a third obstacle region is obtained, wherein the second preset area threshold is smaller than the first preset area threshold. The boundary of the second obstacle in the third obstacle region is extracted based on the morphological operation kernel; The irregular and discontinuous boundaries in the second obstacle boundary are filled and corrected using the contour interpolation method to obtain the third obstacle boundary; The fourth obstacle region is determined based on the boundary of the third obstacle; The target grayscale image is determined based on the fourth obstacle region and non-obstacle region, wherein the pixel grayscale value of the non-obstacle region is less than the adaptive threshold.
7. The method according to claim 1, characterized in that, The process of planning the vehicle's driving path based on the target occupancy grid and the target occupancy probability includes: Based on the target occupancy probability, obstacle grids and non-obstacle grids in the target occupancy grid are determined, wherein the obstacle grid is used to represent grid cells with obstacles, and the non-obstacle grid is used to represent grid cells without obstacles. The obstacle grid and the non-obstacle grid are identified to obtain the drivable area; The vehicle's travel path is planned based on the drivable area.
8. A vehicle, characterized in that, include: Memory, which stores executable programs; A processor for running the executable program, wherein the executable program, when run on the processor, performs the vehicle routing method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the vehicle routing method according to any one of claims 1 to 7 when run on a computer or processor.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the vehicle routing method as described in any one of claims 1 to 7.