Static obstacle detection method based on grid map
Through the static obstacle detection method based on grid diagram, the problem of inaccurate obstacle detection in complex scenarios is solved, high-precision obstacle boundary recognition and rapid detection are achieved, and the environmental perception ability of the autonomous driving system is improved.
Patent Information
- Application Number
- CN202411952832.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-22
AI Technical Summary
The prior art faces challenges in complex scenarios in the identification and processing of static obstacles, resulting in inaccurate obstacle envelope frames, affecting the decision-making and planning process of the vehicle.
The static obstacle detection method based on the raster map is adopted to generate a raster map by obtaining point cloud data, crop local raster maps, perform binarization processing and connectivity domain analysis, filter noise areas, segment and refine obstacle boundaries, and calculate envelope boxes.
It improves the accuracy and robustness of obstacle detection, ensures the accuracy of obstacle boundaries, improves the environmental perception ability of the autonomous driving system, achieves 95% detection accuracy in complex scenarios, and improves the detection speed in multiple obstacle scenarios.
Smart Images

Figure CN119863776A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned driving technology, and in particular to a static obstacle detection method based on a grid map. Background Art
[0002] With the rapid development of autonomous driving technology, environmental perception has become a core element to ensure safe driving. Accurate detection of static obstacles is crucial to avoiding traffic accidents and improving driving safety.
[0003] However, existing technologies face many challenges in identifying and processing static obstacles, especially in complex scenes with unique characteristics and obstacle distribution, such as open parks, trees and seats on urban streets, closed ports, containers and various loading and unloading equipment in mines. These objects have different shapes, making obstacle detection more complicated, which may lead to inaccurate obstacle envelopes output by sensors, thus affecting the vehicle's decision-making and planning process.
[0004] Therefore, the grid-map-based static obstacle detection method we proposed provides a new solution to overcome the shortcomings of traditional technologies and improve the environmental perception capabilities of autonomous driving systems. Summary of the invention
[0005] In view of the deficiencies in the prior art, an object of an embodiment of the present invention is to provide a static obstacle detection method based on a grid map to solve the problems in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A static obstacle detection method based on a grid image comprises the following steps:
[0008] Step 1: Obtain point cloud data and generate a raster map;
[0009] Step 2: Cut out a local grid map based on the current position of the vehicle and set the cutting range to reduce the calculation area;
[0010] Step 3: Binarize the local grid image, mark the occupied area as 1 and the idle area as 0;
[0011] Step 4: Extract the obstacle connected area in the binary raster image through connected domain analysis;
[0012] Step 5: Filter the connected areas according to the preset area threshold to remove small noise areas;
[0013] Step 6: Segment and refine the connected domains whose area exceeds the threshold to more accurately describe the boundaries of obstacles;
[0014] Step 7: Calculate the envelope of the connected area, generate a rotated rectangular box or an axis-aligned rectangular box of the obstacle, and select one based on the specific scene requirements;
[0015] Step 8: Based on the road boundary information of the high-precision map, calculate the distance between the obstacle and the road edge, and determine whether the obstacle is within the road boundary.
[0016] As a further solution of the present invention, the clipping range in step 2 is composed of dynamic distances of the front, back, left and right.
[0017] As a further solution of the present invention, the connected domain analysis in step 4 adopts a double-scan labeling algorithm, performs connectivity judgment based on an 8-neighborhood relationship, and merges adjacent labels according to a label table in a second scan.
[0018] As a further solution of the present invention, the segmentation refinement process in step six sets a dynamic area threshold based on the area of the connected domain and scene requirements to ensure that a larger connected domain is reasonably segmented.
[0019] As a further solution of the present invention, the generation of the envelope in step seven includes calculation of the external convex hull based on the connected area, preferably using an AABB envelope for obstacles of regular shapes and an OBB envelope for obstacles of irregular shapes.
[0020] As a further solution of the present invention, in step eight, the shortest distance between the obstacle and the road boundary is calculated to determine whether the obstacle is within the safe range. If the obstacle is outside the road boundary, the obstacle is filtered as an invalid obstacle.
[0021] As a further solution of the present invention, the processing of step 4 to step 7 is accelerated by using the OMP parallel computing framework to improve the detection speed in a multi-obstacle scenario.
[0022] In summary, compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0023] The laser radar is used to emit laser beams and receive reflected signals to construct a high-precision point cloud map of the environment. The point cloud data is then converted into a grid map, so that the dynamic environment space is divided into a uniform grid, effectively representing the occupancy of static objects in the space. Finally, the shape and position of obstacles are accurately detected by combining grid connectivity analysis and segmentation refinement. First, the occupied area is clearly separated from the idle area by binarization of the grid map. Subsequently, through the grid range connectivity analysis, the system can automatically identify and filter small areas of noise data, thereby improving detection accuracy. At the same time, the large-area occupied grid is further segmented and refined to improve the accuracy of the envelope of irregular objects and ensure that the boundaries of obstacles are more accurate.
[0024] In order to more clearly illustrate the structural features and effects of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The system framework of the embodiment of the invention.
[0026] Figure 2 Schematic diagram of 4-neighborhood and 8-neighborhood in the embodiments of the invention.
[0027] Figure 3 Schematic diagram of the connected domain in the embodiment of the invention.
[0028] Figure 4 It is a schematic diagram of an axis-aligned rectangle and a rotated rectangle in an embodiment of the invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0030] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.
[0031] In one embodiment, a static obstacle detection method based on a grid map is described in detail in Figure 1 to Figure 4 , including the following steps:
[0032] Step 1: Obtain point cloud data and generate a raster map;
[0033] Step 2: Cut out a local grid map based on the current position of the vehicle and set the cutting range to reduce the calculation area;
[0034] Step 3: Binarize the local grid image, mark the occupied area as 1 and the idle area as 0;
[0035] Step 4: Extract the obstacle connected area in the binary raster image through connected domain analysis;
[0036] Step 5: Filter the connected areas according to the preset area threshold to remove small noise areas;
[0037] Step 6: Segment and refine the connected domains whose area exceeds the threshold to more accurately describe the boundaries of obstacles;
[0038] Step 7: Calculate the envelope of the connected area, generate a rotated rectangular box or an axis-aligned rectangular box of the obstacle, and select one based on the specific scene requirements;
[0039] Step 8: Based on the road boundary information of the high-precision map, calculate the distance between the obstacle and the road edge, and determine whether the obstacle is within the road boundary.
[0040] For further information, see Figure 1 to Figure 4 The clipping range in step 2 is composed of the dynamic distances of the front, back, left and right.
[0041] For further information, see Figure 1 to Figure 4 The connected domain analysis in step 4 adopts a double-scan labeling algorithm, performs connectivity judgment based on an 8-neighborhood relationship, and merges adjacent labels according to the label table in the second scan.
[0042] For further information, see Figure 1 to Figure 4 The segmentation refinement process in step six sets a dynamic area threshold based on the area of the connected domain and scene requirements to ensure that the larger connected domain is reasonably segmented.
[0043] For further information, see Figure 1 to Figure 4 The generation of the envelope in step seven includes calculating the external convex hull based on the connected area. Preferably, the AABB envelope is used for obstacles with regular shapes, and the OBB envelope is used for obstacles with irregular shapes.
[0044] For further information, see Figure 1 to Figure 4 In step eight, the shortest distance between the obstacle and the road boundary is calculated to determine whether the obstacle is within the safe range. If the obstacle is outside the road boundary, the obstacle is filtered as an invalid obstacle.
[0045] For further information, see Figure 1 to Figure 4 The processing of steps 4 to 7 is accelerated by using the OMP parallel computing framework to improve the detection speed in multi-obstacle scenarios.
[0046] In this embodiment, the rotated rectangular box is OBB and the axis-aligned rectangular box is AABB;
[0047] Step S1: Raster image preprocessing
[0048] The original raster image contains too large an area, which will take up a lot of computing resources when processed, and most of the area is irrelevant for the current path planning. By cropping and binarizing the original raster image, the preprocessing module can reduce the computing burden and clearly distinguish between occupied and free areas in the local area related to vehicle driving.
[0049] Step S2: Grid connectivity analysis
[0050] The purpose of connecting domain analysis is to extract all possible connected domain information from the local binary grid image. A labeling algorithm (such as depth-first search or breadth-first search) is used to identify the connected areas in the image. Each connected domain will be assigned a unique label, and its length, width, area, coordinates and other information will be counted. In order to remove noise, retain a larger area of connected domains, and ensure the practicality of the detected static obstacle information, the present invention sets a minimum connected domain area threshold Area in combination with different scenarios. min , filtering out connected domains smaller than the threshold. The finally generated connected domain statistics provide the necessary basis for obstacle detection.
[0051] Step S3: Grid connected domain segmentation and refinement
[0052] For the large connected domain after filtering, the present invention designs a segmentation algorithm to avoid the single connected domain being too large to affect the generation of the envelope of the static obstacle. According to different scene settings, the maximum connected domain size in the conventional scene is Length max ×Width max , and in the curved road scene, combined with the road curvature, the maximum connected domain size is reduced to This segmentation method ensures that in complex environments, the bounding box of obstacles can more accurately reflect the actual situation and reduce the risk of the envelope box encroaching on the lane.
[0053] Step S4: Grid conversion to static obstacles
[0054] The convex hull envelope of the grid connected domain after segmentation and refinement is calculated and converted into an obstacle object. Based on the real-time positioning information of the vehicle, the position and envelope of the static obstacle after projection in the world coordinate system are calculated. In order to improve the accuracy and effectiveness of detection, invalid obstacles outside the road are filtered, and static obstacles with potential risks are dynamically taken into consideration by setting the lateral distance LBuffer.
[0055] The step S1 comprises the following steps:
[0056] Step S1.1: Read the length, width, resolution, and image position corresponding to the vehicle according to the original raster image input. Combined with the scene configuration file, dynamically adjust the front, back, left, and right physical range of the local raster image, and then convert it into the raster size range based on the actual resolution. Starting from the image position corresponding to the vehicle, traverse and map the raster elements within the cropping size range, update the length, width, and image position information of the cropped raster image, and finally output the local raster image.
[0057] Step S1.2: Binarize the grayscale image according to the set threshold, mark the area with pixel value higher than the threshold as 1 (occupied), and mark the area below the threshold as 0 (free). Convert the original raster image into a single-channel binary image to clearly separate the occupied area and the free area, so as to facilitate the subsequent connected domain analysis and obstacle detection.
[0058] The step S2 comprises the following steps:
[0059] Step S2.1: There are two ways to define two adjacent pixels in an image: 4-neighborhood and 8-neighborhood. Figure 2 -a, two adjacent pixels must be adjacent in the horizontal and vertical directions, and the coordinates of two adjacent pixels must differ by only one bit and can only differ by one pixel. For example, the four pixels in the 4-neighborhood of point P0 (x, y) are P1 (x-1, y), P2 (x+1, y), P3 (x, y-1), and P4 (x, y+1). Figure 2 -b, two pixels are allowed to be adjacent in the diagonal direction, and the maximum difference between the coordinates of two adjacent pixels in the X and Y directions is 1. For example, the 8 pixels in the 8-neighborhood of point P0 (x, y) are P1 (x-1, y), P2 (x+1, y), P3 (x, y-1), P5 (x-1, y-1), P5 (x+1, y-1), P6 (x-1, y+1), P7 (x+1, y+1) and P8 (x, y). Considering the position and posture distribution of static obstacles, the 8-neighborhood method is used for connected domain analysis.
[0060] Step S2.2: Scan and mark the grid connected domains in two steps.
[0061] The first step of scanning: 1) Initialization: Create a label image. Initially, all pixel labels are set to 0, indicating that they are unlabeled. Define a label counter to assign new labels. 2) Label recording: Traverse the entire grid map, assign a preliminary label to each grid point, and record the connection relationship between adjacent grids. For each foreground grid, check whether its adjacent elements have been labeled and record them. If there is no adjacent label, assign a new label and update the label counter; if there are multiple adjacent labels, they are stored in the same set, indicating that these labels are connected. Record the final assigned label of the grid and the minimum value of the adjacent labels for subsequent merging. If different adjacent labels are found, add them to a union-find set or label map so that they can be merged in the second step of scanning.
[0062] Second step scanning: 1) Unify labels: traverse the entire grid map again, and for each foreground grid, find its smallest adjacent label. Use the union-find set or previously recorded adjacent label information to unify the label of the grid. All connected grids will be assigned the same final label. 2) Output results: The final label grid map marks all connected areas with unique labels. Statistical information (such as area, bounding box, etc.) is output after calculation.
[0063] Step S2.3: Sort by connected domain area, and then set the minimum connected domain area threshold Area based on different scenarios. min , effectively screen the connected domain, remove small area noise, and retain important static obstacle information.
[0064] The step S3 comprises the following steps:
[0065] Step S3.1: Dynamically set the area size of the maximum connected domain according to different scene configurations. The maximum connected domain size in a conventional scene is Length max ×Width max , and in the curved road scene, combined with the road curvature, the maximum connected domain size is reduced to
[0066] Step S3.2, obtain the grid coordinates and bounding box information of the filtered connected domain, and determine the area size of each area. If the width or height of the area exceeds the set threshold, the area is further divided into smaller sub-areas to improve the accuracy of static obstacle generation. By calculating the horizontal and vertical segmentation points, the grid coordinates are grouped and stored in a new set to ensure that each sub-area can be accurately marked. During the subdivision process, each new area is assigned a unique label, and the label information at the corresponding grid is updated. Finally, as Figure 3 All the sub-connected domains after segmentation and refinement are output as the coverage area of each static obstacle.
[0067] The step S4 comprises the following steps:
[0068] Step S4.1: The system calculates the reference line and road section related to the current position of the vehicle based on the high-precision map through the real-time positioning and driving speed information of the vehicle to obtain the local road environment information around the vehicle. This information is crucial for evaluating the relative position of obstacles and roads, so as to effectively determine whether obstacles have the potential to affect the safety of vehicle driving.
[0069] Step S4.2: The system calculates the convex hull structure of each connected domain’s geometric features to obtain the external contour point set of the connected domain. We define two ways to generate static obstacle envelopes in the configuration: Figure 4 -a axis-aligned rectangular box, one is Figure 4 -b shows the rotating rectangular box. Depending on the application scenario, different methods are selected to generate the outer envelope of the static obstacle. At the same time, considering the impact of the number of obstacles on resource consumption, we introduced the 0MP parallel computing framework. When the number of obstacles exceeds the preset threshold, parallel computing is enabled to improve processing efficiency; otherwise, single-threaded processing is used. This ensures that resource utilization in a multi-threaded environment is maximized to improve the overall algorithm performance.
[0070] Step S4.3: The system detects the position of the road boundary for the generated static obstacle. By comparing the geometric features of the obstacle with the acquired local road environment, it is determined whether it is within the safe range of the road edge. Considering the potential safety risks when the obstacle intersects the road boundary, and the deviation between the description of the road boundary in the high-precision map and the real road, we set a safety distance to increase safety and robustness, and reduce the risk of accidents caused by excessive filtering.
[0071] Example 1: Raster Image Preprocessing
[0072] In autonomous driving scenarios, the environment is usually constructed from high-precision point clouds generated by LiDAR scanning. First, the point cloud data is converted into a raster map to generate the occupancy of the vehicle's current surroundings. Specifically, the raster map consists of equally divided grids of a specified size, and the original resolution is adjustable to ensure a balance between accuracy and processing speed. On this basis, the following steps are performed:
[0073] 1. Clipping the local grid map: Based on the current position of the vehicle, the system reads the front, rear, left, and right clipping ranges set in the configuration file and clips the local grid map from the global grid map. This can reduce the processing scope, reduce the computational burden, and focus on the area related to the vehicle path.
[0074] 2. Binarization: Use the set threshold to binarize the grayscale image, marking the occupied area as 1 and the idle area as 0.
[0075] Example 2: Grid Connectivity Analysis
[0076] After the local grid map is binarized, the area where the obstacle is located is extracted through the connected domain analysis technology, and the connectivity is determined in combination with the 8-neighborhood relationship.
[0077] 1. Connected domain labeling: The system uses a classic dual-scan labeling algorithm. In the first scan, each pixel is given a preliminary label, and the labels of adjacent connected domains are recorded in the label table. In the second scan, the adjacent labels are merged according to the label table to achieve connected domain labeling of all pixels, and finally generate a connected domain map containing obstacle boundaries.
[0078] 2. Connected domain filtering: After completing the marking, the system calculates the area of each connected domain and filters out the noise area with an area lower than the set threshold (for example, 1 square meter), retaining larger and more valuable obstacle information to avoid small noise affecting the detection results.
[0079] Example 3: Grid Connected Domain Segmentation and Refinement
[0080] In complex scenes, obstacles may have complex structures, which may cause the area of a single connected domain to be too large and unable to accurately describe its boundaries. Therefore, we propose a scene-based segmentation refinement algorithm to decompose large connected domains into smaller blocks that are more in line with actual shapes.
[0081] 1. Dynamically set the maximum connected domain area: Differentiate between regular and curved scenarios based on the road curvature, and dynamically adjust the maximum connected domain area. This prevents a large area of the envelope from covering the road surface, which would result in inaccurate planning paths.
[0082] 2. Further segmentation: For connected domains that exceed the area threshold, the system will subdivide them according to the set horizontal and vertical segmentation points. Each newly generated area is assigned a unique label and recorded in the segmented grid map to ensure that the segmented obstacles can be accurately marked and identified.
[0083] Example 4: Obstacle Envelope Generation
[0084] Based on the grid connected domain after segmentation and refinement, the system converts obstacles into structured geometric objects. Specifically, the obstacle boundary is generated by calculating the convex hull structure or rectangular box envelope.
[0085] 1. Envelope box generation: Generate the obstacle's rotated rectangular box (OBB) or axis-aligned rectangular box (AABB) by calculating the external convex hull of the connected domain. The choice depends on the specific scene requirements. Experiments show that for obstacles with regular shapes, the AABB box works best; for irregular shapes, the OBB can more accurately describe the boundary.
[0086] 2. Multi-threaded acceleration: To improve the detection speed, when the number of obstacles reaches a certain number, the system automatically enables OMP parallel processing, and each grid domain calculates the envelope in parallel, greatly improving processing efficiency.
[0087] Example 5: Road Boundary Detection
[0088] Based on the vehicle's real-time positioning data, the system compares the generated obstacles with the road boundaries of the high-precision map to determine whether they are within a safe range.
[0089] 1. Boundary distance calculation: Based on the shortest distance between the obstacle position and the road boundary, the system determines whether it is outside the lane. If so, it will filter it as an invalid obstacle; if not, it will dynamically calculate the safe distance between the obstacle and the lane edge. This avoids potential safety hazards caused by obstacles too close to the road.
[0090] The working principle of the present invention is:
[0091] The grid-based static obstacle detection method proposed in the present invention significantly improves the accuracy and robustness of static obstacle detection in autonomous driving systems, and solves the problems of high misjudgment rate and inaccurate boundary recognition in traditional detection methods in complex scenarios. Through connected domain analysis and segmentation refinement technology, the boundary of the obstacle can more accurately reflect its actual shape. Experimental data show that this method achieves a detection accuracy of about 95% in closed complex scenes. In terms of processing efficiency, the OMP parallel computing framework is introduced. In the test scenario with dense obstacles, the overall detection speed is increased by about 5 times, meeting the real-time detection requirements.
[0092] This technical solution also shows significant advantages in terms of economic and social benefits: its high-precision obstacle recognition capability reduces the system's additional computing requirements, reduces the energy consumption of redundant computing, improves vehicle safety and passenger comfort, helps further promote the practical application of unmanned driving technology, and has broad industrialization prospects.
[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A static obstacle detection method based on a grid map, characterized in that: The following steps are involved: Step 1: Obtain point cloud data and generate a raster map; Step 2: Cut out a local grid map based on the current position of the vehicle and set the cutting range to reduce the calculation area; Step 3: Binarize the local grid image, mark the occupied area as 1 and the idle area as 0; Step 4: Extract the obstacle connected area in the binary raster image through connected domain analysis; Step 5: Filter the connected areas according to the preset area threshold to remove small noise areas; Step 6: Segment and refine the connected domains whose area exceeds the threshold to more accurately describe the boundaries of obstacles; Step 7: Calculate the envelope of the connected area, generate a rotated rectangular box or an axis-aligned rectangular box of the obstacle, and select one based on the specific scene requirements; Step 8: Based on the road boundary information of the high-precision map, calculate the distance between the obstacle and the road edge, and determine whether the obstacle is within the road boundary.
2. The static obstacle detection method based on grid graph according to claim 1, characterized in that: The clipping range in step 2 is composed of the dynamic distances of the front, back, left and right.
3. The static obstacle detection method based on grid graph according to claim 2, characterized in that: The connected domain analysis in step 4 adopts a double-scan labeling algorithm, performs connectivity judgment based on an 8-neighborhood relationship, and merges adjacent labels according to the label table in the second scan.
4. The static obstacle detection method based on grid graph according to claim 3, characterized in that: The segmentation refinement process in step six sets a dynamic area threshold based on the area of the connected domain and scene requirements to ensure that the larger connected domain is reasonably segmented.
5. The static obstacle detection method based on grid graph according to claim 4, characterized in that: The generation of the envelope in step seven includes calculation of the external convex hull based on the connected area. Preferably, the AABB envelope is used for obstacles with regular shapes, and the OBB envelope is used for obstacles with irregular shapes.
6. The grid-map-based static obstacle detection method according to claim 5, characterized in that: In step eight, the shortest distance between the obstacle and the road boundary is calculated to determine whether the obstacle is within the safe range. If the obstacle is outside the road boundary, the obstacle is filtered as an invalid obstacle.
7. The grid-map-based static obstacle detection method according to claim 6, characterized in that: The processing of steps 4 to 7 is accelerated using the OMP parallel computing framework to improve the detection speed in multi-obstacle scenarios.