A method for calculating obstacle contours in automatic driving in underground mines

By using AABB bounding boxes and spatial index algorithms in underground mine autonomous driving, combined with noise point judgment and polygon contour calculation, the problem of low obstacle contour calculation accuracy in underground mine autonomous driving is solved, efficient and accurate obstacle contour extraction is achieved, and the real-time performance and safety of the autonomous driving system are improved.

CN118982812BActive Publication Date: 2025-09-30LEIKE ZHITU (BEIJING) TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411131958.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-09-30
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

The calculation accuracy of obstacle contours in underground mine autonomous driving is low, and existing methods have problems such as large redundant space and high computational complexity in complex environments.

Method used

By obtaining obstacle point cloud data, using AABB bounding box and spatial index algorithm, combined with noise judgment, uniform downsampling and polygon outline calculation, the compact outline of the obstacle is extracted, including rotation transformation and intersection calculation, and the nearest intersection is found using ktree index.

Benefits of technology

It improves the accuracy and efficiency of obstacle contour calculation, reduces redundant space, simplifies contour complexity, and improves the real-time performance and safety of the autonomous driving system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982812B_ABST
    Figure CN118982812B_ABST
Patent Text Reader

Abstract

The present application discloses a method for calculating the outline of an obstacle in an autonomous driving underground mine, which relates to the field of unmanned driving, including: obtaining clustered obstacle point cloud data; judging whether it is a noise point based on the number of points in the obstacle point cloud data; for obstacle point clouds that are not noise points, calculating the AABB bounding box outline by counting the number of point clouds and uniformly downsampling the point clouds; judging whether the preset polygon outline calculation conditions are met based on the AABB bounding box outline; rotating and calculating the intersection of the calculated AABB bounding box outline, finding the intersection closest to the obstacle point cloud by establishing a ktree index and sorting the intersections to obtain the circumscribed polygon outline of the obstacle; calculating the angle between adjacent points and simplifying the points on the circumscribed polygon outline to obtain the final outline of the obstacle. In view of the low accuracy of obstacle outline calculation in the process of autonomous driving in underground mines in the prior art, the present application improves the accuracy of outline extraction while ensuring calculation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of unmanned driving, and in particular to a method for calculating obstacle contours in autonomous driving in underground mines. Background Art

[0002] With the development of modern mining, underground mine environments are becoming increasingly complex. Traditional manual driving methods are no longer able to meet the demands of safe and efficient production. To improve mining efficiency and ensure the safety of workers, autonomous driving technology has gained widespread attention and application in underground mines. Autonomous driving systems in underground mines utilize computer vision, navigation and positioning, trajectory planning, and motion control technologies to enable autonomous navigation and obstacle avoidance for unmanned vehicles. In the complex and ever-changing environment of underground mines, autonomous vehicles must perceive their surroundings in real time, identify the location and shape of obstacles, and plan safe and efficient driving paths. Therefore, accurate and real-time acquisition of obstacle outline information is crucial for autonomous driving systems to perform environmental perception and decision-making.

[0003] Currently, autonomous driving systems in underground mines primarily use sensors such as LiDAR to acquire environmental information and extract obstacle contours through point cloud data processing and analysis. However, due to the complex and volatile nature of underground mine tunnels and the inherent vibration of moving vehicles, the acquired obstacle point cloud data varies significantly, placing higher demands on contour extraction algorithms. Traditional obstacle contour representation methods, such as bounding spheres, AABBs (axis-aligned bounding boxes), and OBBs (oriented bounding boxes), have limitations when dealing with the complex environments of underground mines. While computationally simple, the bounding sphere method introduces significant redundancy. For obstacles such as slender walls, the bounding sphere can even cover the entire drivable area, resulting in significant contour deviations. While simple to construct, the AABB bounding box method also introduces significant redundancy and contour deviations for irregular and rotated obstacles. While the OBB bounding box method offers a more compact representation of obstacle contours, it is computationally complex, suffers from poor real-time performance, and struggles to achieve a close fit with large walls over ten meters long. However, the generated obstacle contours are highly redundant and irregular in shape, particularly for large, moving obstacles. This severely impacts the rationality of autonomous vehicle trajectory planning and obstacle avoidance decisions, reducing the smoothness and safety of vehicle operation. Therefore, there is an urgent need for an obstacle contour calculation method suitable for the complex environments of underground mines that can quickly and accurately extract the compact contours of moving obstacles, providing high-quality environmental perception data for autonomous driving systems and improving the vehicle's obstacle avoidance and navigation performance. Summary of the Invention

[0004] 1. Technical problems to be solved

[0005] In response to the problem of low accuracy in obstacle contour calculation during autonomous driving in underground mines in the existing technology, the present application provides a method for calculating obstacle contours in autonomous driving in underground mines. It fully utilizes the spatial distribution characteristics of point clouds, combines AABB bounding boxes and spatial index algorithms, simplifies contours, and improves the accuracy of contour extraction while ensuring computational efficiency.

[0006] 2. Technical solution

[0007] The purpose of this application is achieved through the following technical solutions.

[0008] The present application provides a method for calculating obstacle contours in automatic driving in underground mines, including: S1, obtaining clustered obstacle point cloud data; S2, judging whether it is a noise point based on the number of points in the obtained obstacle point cloud data, and when the number of noise points is less than the noise threshold, not performing contour calculation; for obstacle point clouds that are not noise points, calculating the AABB bounding box contour by counting the number of point clouds and uniformly downsampling the point clouds, and obtaining the length, width, center point and rotation angle of the bounding box matrix; S3, judging whether a preset polygon contour calculation condition is met based on the length and width of the calculated AABB bounding box contour and the distance from the bounding box corner point to the obstacle point; S4, when it is judged that the polygon contour calculation condition is met, rotating and calculating the intersection of the calculated AABB bounding box contour, finding the intersection closest to the obstacle point cloud by establishing a ktree index and sorting the intersections, and obtaining the circumscribed polygon contour of the obstacle; S5, calculating the angle between adjacent points and simplifying the points of the obtained circumscribed polygon contour, and obtaining the downsampled polygon contour as the final contour of the obstacle.

[0009] Clustered obstacle point cloud data: Point cloud data refers to a collection of points in three-dimensional space acquired by sensors such as lidar and depth cameras. Each point contains its coordinate information (x, y, z). Clustering is the process of dividing points in point cloud data into different categories or groups based on a certain similarity metric. Clustered obstacle point cloud data refers to the subset of point clouds representing different obstacles obtained by clustering the original point cloud data. Noise points are abnormal or outliers in point cloud data, typically caused by factors such as sensor measurement errors and environmental interference. Noise points are characterized by coordinate values ​​or other attribute values ​​that significantly deviate from the normal range compared to surrounding points. In obstacle contour calculation, noise points need to be identified and filtered to prevent them from affecting the contour calculation results. Downsampling involves selecting a subset of points from the original point cloud data as representatives to reduce the number of points and computational complexity. Uniform downsampling is a commonly used downsampling method that aims to minimize the number of points while maintaining the overall shape and distribution characteristics of the point cloud. Specific implementation methods include voxel downsampling and grid downsampling. These methods divide the point cloud into uniform voxels or grids and select representative points within each voxel or grid as the downsampling result. AABB stands for axis-aligned bounding box, which represents an axis-aligned bounding box. An AABB bounding box is a simple and effective bounding volume representation method. By calculating the minimum and maximum values ​​of the point cloud data along each coordinate axis, a rectangular box tightly encloses the point cloud is obtained. The AABB bounding box outline is a rectangular outline representing the approximate shape and location of an obstacle, obtained by calculating the AABB bounding box of the point cloud data. The ktree is a commonly used spatial index data structure for organizing and querying point data in multidimensional space. The ktree recursively divides the space into non-overlapping subspaces and stores point data in the corresponding subspaces, forming a tree-like hierarchical structure. In obstacle outline calculation, the ktree index can be used to accelerate nearest neighbor point searches. Specifically, the ktree searches for the obstacle point cloud points closest to a given point to extract the vertices of the circumscribed polygon.

[0010] Furthermore, S2, according to the number of points of the obtained obstacle point cloud data, determines whether it is a noise point, and for the obstacle point cloud of non-noise point, calculates the AABB bounding box contour, including: S21, obtaining the number of points of the clustered obstacle point cloud, and comparing the number of points of the point cloud with the preset noise threshold a; when the number of points of the point cloud is less than the noise threshold a, the corresponding point cloud is determined to be a noise point, and subsequent contour calculation is not performed; when the number of points of the point cloud is greater than or equal to the noise threshold a, the corresponding point cloud is determined to be a non-noise point; S22, for the point cloud determined to be non-noise point in step S21, the corresponding number of points is compared with the preset downsampling threshold b; when the number of points of the point cloud is less than the downsampling threshold When the value is b, directly execute step S24; otherwise, use the uniform downsampling algorithm to downsample the corresponding point cloud; S23, for the point cloud obtained by the uniform downsampling process in step S22, by calculating the angle between any two points of the corresponding point cloud, obtain the direction with the largest angle as the direction of the bounding box; S24, according to the bounding box direction, rotate the original obstacle point cloud determined as non-noise points in step S21 to make the direction of the obstacle point cloud consistent with the direction of the bounding box; calculate the AABB bounding box of the point cloud after the rotation transformation, update the length, width, center point coordinates and rotation angle of the bounding box matrix, and obtain the updated AABB bounding box outline.

[0011] Further, S22, when the number of points in the point cloud is less than the downsampling threshold b, directly execute step S24, including: for the point cloud determined as non-noise points in step S21, compare the corresponding number of points with the preset downsampling threshold b; when the number of points in the point cloud is less than the downsampling threshold b, calculate the covariance matrix of the corresponding point cloud; perform eigenvalue decomposition on the covariance matrix, take the eigenvector with the largest eigenvalue as the main direction of the point cloud, and then directly execute step S24.

[0012] Among them, the covariance matrix is ​​a statistic used to describe the correlation and dispersion between multidimensional random variables. In the context of point cloud data, the covariance matrix represents the correlation between the various coordinate axes in the point cloud and the distribution of points. The covariance matrix is ​​a symmetric matrix whose main diagonal elements represent the variance of the points on each coordinate axis, and the non-main diagonal elements represent the covariance of the points between different coordinate axes. By calculating the covariance matrix of point cloud data, the statistical characteristics of the point cloud, such as the main direction and shape characteristics of the point cloud, can be obtained. The main direction of a point cloud refers to the main trend or direction of the distribution of point cloud data in space. The main direction usually corresponds to the maximum variance or minimum inertia direction of the point cloud data on a certain coordinate axis.

[0013] In step S22, the main direction of the point cloud can be obtained by performing eigenvalue decomposition on the covariance matrix of the point cloud data. Specifically, the eigenvalues ​​of the covariance matrix represent the variance of the point cloud in different directions, and the eigenvectors represent the corresponding directions. The eigenvector with the largest eigenvalue is the main direction of the point cloud, indicating that the distribution of the point cloud data in this direction is the most dispersed or extended. In step S22, when the number of points in the point cloud is less than the preset downsampling threshold b, the covariance matrix of the point cloud is directly calculated, and the main direction of the point cloud is obtained by eigenvalue decomposition. This processing method is suitable for cases with a small number of points and can avoid the computational overhead of performing uniform downsampling. By calculating the covariance matrix and main direction of the point cloud, important statistical features of the point cloud data can be obtained, providing valuable information for subsequent obstacle contour calculations. The main direction of the point cloud can be used to determine the direction of the AABB bounding box, or as a reference direction for extracting polygon contours to improve the accuracy and efficiency of contour calculation.

[0014] Furthermore, S22, a uniform downsampling algorithm is used to downsample the corresponding point cloud, including: determining the target resolution of the uniform downsampling according to the density of the original obstacle point cloud; performing three-dimensional spatial division on the original obstacle point cloud, dividing the point cloud into multiple cube grids of equal size, with the side length of each grid equal to the target resolution; traversing each point in the original obstacle point cloud, and determining the cube grid to which each point belongs according to the coordinate value; counting the number of points of the original obstacle point cloud contained in each cube grid; if the number of points is greater than or equal to 1, calculating the average coordinate value of all points in the grid as the representative point of the grid; if the number of points is equal to 0, not generating a representative point in the downsampled point cloud; and using the representative points of all grids as the downsampled obstacle point cloud.

[0015] Among them, the target resolution refers to the parameter used to determine the size of the cube grid during the uniform downsampling process. The resolution is usually expressed as a length value, such as 0.1 meters, 0.2 meters, etc., which represents the side length of each cube grid. The choice of target resolution depends on the density of the original point cloud and the desired downsampling effect. A smaller target resolution will generate a denser grid, retaining more point cloud details; a larger target resolution will generate a sparser grid, and the number of point clouds after downsampling will be smaller. By setting an appropriate target resolution, a balance can be achieved between the quality of the downsampled point cloud and computational efficiency. The representative point of the grid refers to the single point used to represent each cube grid during the uniform downsampling process.

[0016] In step S22, after the original obstacle point cloud is divided into multiple cubic grids of equal size, a representative point needs to be selected for each grid. If the grid contains one or more original point cloud points, the coordinate average of these points is calculated, and the average coordinate is used as the representative point of the grid. The average coordinate represents the geometric center of the points in the grid and can better represent the overall position of the points in the grid. If the grid does not contain any original point cloud points, the representative point of the grid is not generated in the downsampled point cloud to avoid introducing meaningless points. The representative points of the grid constitute the downsampled obstacle point cloud, which approximates the shape and distribution characteristics of the original point cloud at a lower resolution. The uniform downsampling algorithm achieves point cloud downsampling processing by dividing the original point cloud into uniform cubic grids and selecting representative points for each grid. The target resolution controls the size of the grid and the density of the downsampled point cloud. The representative points of the grid are used to simplify the representation of the point cloud and reduce the amount of point cloud data. By reasonably setting the target resolution and calculating representative points based on the distribution of points within the grid, the uniform downsampling algorithm can effectively reduce the complexity of the point cloud while maintaining the overall shape of the point cloud, thereby improving the efficiency of subsequent contour calculations.

[0017] Preferably, the target resolution of the downsampling process is adaptively determined based on the local point density and curvature change characteristics of the original obstacle point cloud, including: dividing the original obstacle point cloud into several sub-areas, calculating the point density and curvature change value in each sub-area; for sub-areas with higher point density and larger curvature change, selecting a smaller target resolution to retain more point cloud details; for sub-areas with lower point density and smaller curvature change, selecting a larger target resolution to reduce the point cloud density; using the octree algorithm to perform three-dimensional space division on the original obstacle point cloud, recursively dividing the point cloud into eight equal-sized cubic grids, until the number of points contained in each grid is less than or equal to a preset threshold, or the number of points in the grid is less than or equal to the preset threshold. The side length is less than or equal to the target resolution. Each cubic grid obtained by the octree algorithm is traversed, and the downsampling method is adaptively determined based on the number and distribution characteristics of the original obstacle point cloud contained within the grid. If the number of points within the grid is greater than a preset threshold and the point distribution is relatively uniform, the coordinates of all points within the grid are averaged and used as the representative point of the grid. If the number of points within the grid is greater than the preset threshold but the point distribution is uneven, the points within the grid are clustered using local mean shift, and the center point of each cluster is used as the representative point of the grid. If the number of points within the grid is less than or equal to the preset threshold, all points within the grid are retained. All the resulting representative points constitute the downsampled obstacle point cloud. Based on the local point density and curvature variation characteristics of the original point cloud, the target resolution is adaptively determined for different subregions, retaining more points in areas with rich point cloud detail and reducing point cloud density in areas with sparser and flatter points. This approach reduces data volume while preserving key features. Furthermore, the improved scheme uses the octree algorithm to partition the point cloud into three dimensions, recursively partitioning the point cloud to obtain a grid that adapts to the local point cloud distribution. Within each grid, different downsampling methods are adaptively selected based on the number and distribution characteristics of the points. Both direct averaging and local mean shift clustering are used to better preserve the overall distribution characteristics of the point cloud.

[0018] Furthermore, S24 updates the AABB bounding box outline, including: calculating the angle between the bounding box direction obtained in step S23 and the main direction of the original obstacle point cloud as a rotation transformation angle; constructing a rotation transformation matrix based on the rotation transformation angle, performing a rotation transformation on each point in the original obstacle point cloud determined as a non-noise point in step S21, and obtaining the obstacle point cloud after the rotation transformation; calculating the minimum and maximum values ​​in the X-axis, Y-axis and Z-axis directions based on the obstacle point cloud after the rotation transformation, and updating the length, width and height of the AABB bounding box; calculating the geometric center point coordinates of the obstacle point cloud after the rotation transformation as the center point coordinates of the updated AABB bounding box; using the rotation transformation angle as the rotation angle of the updated AABB bounding box; constructing the updated AABB bounding box outline based on the length, width, center point coordinates and rotation angle of the updated AABB bounding box.

[0019] Among them, the rotation transformation is a geometric transformation used to rotate the point cloud data around a certain axis or direction by a certain angle. In three-dimensional space, the rotation transformation is usually represented by a rotation matrix, which is an orthogonal matrix that describes the direction and angle of rotation. The purpose of the rotation transformation is to convert the point cloud data from the original coordinate system to a new coordinate system so that the direction of the point cloud in the new coordinate system is aligned with a reference direction. In step S24, the angle of the rotation transformation is determined by calculating the angle between the direction of the AABB bounding box and the main direction of the original obstacle point cloud. According to the rotation transformation angle, a rotation transformation matrix is ​​constructed, and a rotation transformation is performed on each point in the original obstacle point cloud to obtain the obstacle point cloud after the rotation transformation. By performing a rotation transformation on the original obstacle point cloud, the direction of the point cloud can be aligned with the direction of the AABB bounding box, so that the bounding box can more tightly surround the obstacle point cloud.

[0020] Specifically, step S24 first calculates the angle between the orientation of the AABB bounding box and the main orientation of the original obstacle point cloud as the rotation transformation angle. This angle represents the degree of deviation between the orientation of the bounding box and the main orientation of the point cloud. Then, a rotation transformation matrix is ​​constructed based on the rotation transformation angle, and a rotation transformation is performed on each point in the original obstacle point cloud. The rotation transformation rotates each point in the point cloud by a specified angle around an axis or direction, resulting in a rotated obstacle point cloud. After the rotation transformation, the orientation of the obstacle point cloud is aligned with that of the AABB bounding box, allowing the bounding box to more tightly enclose the point cloud. Based on the rotated point cloud, the length, width, height, and center point coordinates of the AABB bounding box are recalculated, and the rotation transformation angle is used as the rotation angle of the bounding box, ultimately obtaining the updated AABB bounding box outline. Through the rotation transformation, the orientation of the AABB bounding box and the obstacle point cloud can be aligned, improving the compactness and representation accuracy of the bounding box. This is very important for the subsequent calculation and processing of the obstacle outline, and can more accurately describe the position, size, and orientation information of the obstacle.

[0021] Furthermore, S3 determines whether the preset polygon outline calculation conditions are met based on the calculated length and width of the AABB bounding box outline and the distance from the corner point of the bounding box to the obstacle point, including: determining whether the length of the AABB bounding box outline obtained in step S2 is less than the preset length threshold, whether the width is less than the preset width threshold, and whether the distance from the corner point of the AABB bounding box to the obstacle point cloud is less than the preset distance threshold; when all three conditions are met at the same time, execute step S4, otherwise, use the AABB bounding box outline obtained in step S2 as the final outline of the obstacle.

[0022] Furthermore, in S4, when it is determined that the polygonal contour calculation conditions are met, the calculated AABB bounding box contour is rotated and the intersection is calculated, and the intersection point is found by establishing a ktree index to find the intersection point closest to the obstacle point cloud and sort the intersection points to obtain the circumscribed polygonal contour of the obstacle, including: S41, according to a preset angle threshold, the AABB bounding box contour that is determined to meet the polygonal contour calculation conditions in step S3 is rotated to obtain multiple rotated bounding boxes; S42, the intersection point of each rotated bounding box is calculated with the original AABB bounding box to obtain an intersection point set, and all the intersection points in the intersection point set are sorted in a clockwise direction to obtain a sorted intersection point set; S43, the index of the sorted intersection point set is established by using the ktree algorithm, and the sorted intersection point set is traversed. For each intersection point in the point set, the nearest intersection point to the non-noise obstacle point cloud in step S2 is searched by index, and all the nearest intersection points are extracted to form a nearest intersection set; S44, the nearest intersection set is sorted in a clockwise direction to obtain a sorted nearest intersection set, and the sorted nearest intersection set is connected to form a closed obstacle circumscribed polygonal outline; S45, the angle between the three adjacent vertices in the obtained obstacle circumscribed polygonal outline is calculated. When the angle is greater than a preset simplified angle threshold, the two end vertices are retained, the middle vertex is removed, and the obstacle circumscribed polygonal outline is updated. The vertex removal process is repeated until the number of vertices in the obstacle circumscribed polygonal outline is less than the preset point number threshold b, and the obstacle circumscribed polygonal outline after downsampling and simplification is obtained as the final obstacle circumscribed polygonal outline.

[0023] Furthermore, S43, the ktree algorithm is used to establish an index of the sorted intersection set, each intersection in the sorted intersection set is traversed, and the intersection closest to the non-noise obstacle point cloud in step S2 is found through the index, and all the nearest intersections are extracted to form a nearest intersection set, including: using the octree algorithm to perform spatial division on the sorted intersection set obtained in step S42, and recursively dividing the three-dimensional space into eight sub-regions of equal size until the number of intersections contained in each sub-region is less than a preset segmentation threshold, or the size of the sub-region is less than a preset minimum size threshold; for each sub-region divided by the octree algorithm, the included intersections are traversed, and for each intersection, the K nearest neighbor algorithm is used to search for the K obstacle points closest to the corresponding intersection in the non-noise obstacle point cloud obtained in step S2; and calculating the corresponding The average distance from the intersection point to the K nearest obstacle points is calculated, and the intersection point with the smallest average distance is taken as the nearest intersection point of the corresponding sub-area; all sub-areas divided by the octree algorithm are traversed, the nearest intersection point of each sub-area is extracted, and the nearest intersection point set is constructed according to the original order of the nearest intersection points in the sorted intersection point set; the nearest intersection point set is downsampled, and the distance between adjacent nearest intersection points is calculated. When the distance is less than the preset merge distance threshold, the two nearest intersection points are merged into one nearest intersection point, and the nearest intersection point set is updated; the merge operation is repeated until the distance between any two nearest intersection points in the nearest intersection point set is greater than the merge distance threshold; the obtained nearest intersection point set is used as the vertex set of the obstacle circumscribed polygon outline, and the vertices are connected in the order of the vertices in the nearest intersection point set to form a closed obstacle circumscribed polygon outline.

[0024] An octree is a tree-like data structure used to represent three-dimensional spatial data. It recursively divides a three-dimensional space into eight equally sized subregions (octants), each corresponding to a node in the tree. During the octree construction process, if the number of data points in a subregion exceeds a preset segmentation threshold, or if the subregion's size exceeds a preset minimum size threshold, the subregion is recursively partitioned until a stopping condition is met. An octree's leaf nodes represent the smallest indivisible subregions, while non-leaf nodes represent parent regions containing subregions. The octree algorithm, through spatial partitioning and hierarchical organization, enables efficient indexing and querying of three-dimensional space, accelerating data retrieval and processing. The K-Nearest Neighbors (KNN) algorithm is a commonly used supervised learning algorithm for classification and regression problems. For a given query point, the K nearest sample points in the training dataset are searched for. The query point is then classified or predicted based on the categories or attribute values ​​of these K sample points.

[0025] In step S43, the sorted intersection set is first spatially partitioned using the octree algorithm, recursively dividing the three-dimensional space into eight subregions until the number of intersections in each subregion is less than the segmentation threshold or the subregion size is less than the minimum size threshold. The octree algorithm organizes the intersection set into a hierarchical tree structure, facilitating rapid retrieval and processing. Then, for each subregion partitioned using the octree algorithm, the K-nearest neighbor algorithm is used to search the non-noise obstacle point cloud for the K nearest obstacle points to each intersection. The average distance from the intersection to the nearest obstacle point is calculated, and the intersection with the smallest average distance is selected as the nearest intersection point for that subregion. This step uses the K-nearest neighbor algorithm to locate the closest obstacle point to the intersection in the obstacle point cloud, which is used to determine the vertices of the circumscribed polygon outline. By traversing all subregions, the nearest intersection points of each subregion are extracted and a set of nearest intersection points is constructed in the original order. Finally, the set of nearest intersection points is downsampled, and intersection points with close distances are merged to obtain the simplified vertex set of the obstacle circumscribed polygon outline. The octree algorithm and the K-nearest neighbor algorithm play an important role in step S43. The octree algorithm is used to spatially partition and index the intersection set to accelerate the retrieval of the nearest intersection point; the K-nearest neighbor algorithm is used to search for the obstacle point closest to the intersection point in the obstacle point cloud and determine the vertices of the circumscribed polygon outline.

[0026] Preferably, the sorted intersection set obtained in step S42 is spatially divided using an adaptive KD-tree algorithm. The division dimension and division position are adaptively selected based on the local density and directional characteristics of the intersection distribution, and the three-dimensional space is recursively divided into two sub-areas until the number of intersections contained in each sub-area is less than a preset segmentation threshold, or the maximum side length of the sub-area is less than a preset minimum size threshold; wherein, the selection of the division dimension is based on the variance of the intersections in the sub-area on the three coordinate axes, and the dimension with the largest variance is selected for division; the selection of the division position is based on the median of the intersections in the sub-area on the selected division dimension, and the sub-area is divided into two parts with the median as the boundary; utilizing the nearest neighbor search function of the KD-tree algorithm, for each intersection in the sorted intersection set, the K nearest obstacle points are searched in the KD-tree index, where K is the preset number of nearest neighbor points; during the search process, by comparing the intersection with the division dimension coordinates of the KD-tree tree node, a recursive downward search is performed until a leaf node is reached; and then according to The Euclidean distance between the intersection point and the obstacle point in the leaf node is used to select the K nearest obstacle points. For each intersection point, the average distance to the K nearest neighboring obstacle points found in step S432 is calculated. The intersection point with the smallest average distance is regarded as the nearest intersection point for the corresponding intersection and retained in the nearest intersection point set. The nearest intersection point set is adaptively downsampled, and the downsampling algorithm and parameters are adaptively selected based on the local density and distribution characteristics of the nearest intersection point. For areas with high local density and relatively uniform distribution, a voxel downsampling algorithm is used to divide the three-dimensional space where the nearest intersection point is located into equal-sized cubic grids. The coordinate average of the nearest intersection point in each grid is calculated to generate a new nearest intersection point. For areas with low local density or uneven distribution, a mean shift clustering algorithm is used to cluster the nearest intersection points, and the centroid of each cluster is used as the new nearest intersection point. The resulting downsampled nearest intersection point set is used as the vertex set of the obstacle circumscribed polygon outline. The vertices are connected in the order they appear in the nearest intersection point set to form a closed obstacle circumscribed polygon outline. An adaptive KD-tree algorithm is used to establish a spatial index for the sorted intersection set. The partitioning dimensions and locations are adaptively selected based on the local characteristics of the intersection distribution, which can better adapt to the uneven distribution of intersections and improve search efficiency. During the nearest neighbor search process, the tree structure of the KD-tree is used to quickly narrow the search range and find the K obstacle points closest to each intersection, reducing unnecessary distance calculations. When extracting the nearest intersection, the optimal intersection is selected by calculating the average distance, taking into account the influence of multiple nearest neighbor points and improving the robustness of the nearest intersection extraction. When downsampling the nearest intersection set, an adaptive downsampling strategy is adopted, selecting different downsampling algorithms and parameters based on the local characteristics of the nearest intersection.For dense and evenly distributed areas, a voxel downsampling algorithm is used to quickly reduce the number of points. For sparse or unevenly distributed areas, a mean-shift clustering algorithm is used to preserve the distribution characteristics of key points. This adaptive downsampling process reduces the amount of data while maximally preserving the geometric characteristics of the obstacle outline. Finally, the set of nearest intersection points after downsampling is sequentially connected to generate a closed polygonal outline of the obstacle, completing the obstacle outline extraction process.

[0027] Furthermore, S5 calculates the angles between adjacent points of the obtained circumscribed polygonal contour and simplifies the points to obtain the downsampled polygonal contour as the final contour of the obstacle, including: S51, projects the circumscribed polygonal contours of the multiple obstacles obtained in step S4 onto the XOY plane, and calculates the intersection area of ​​any two circumscribed polygonal contours; compares the intersection area with the area of ​​the contour with the smaller area of ​​the two circumscribed polygonal contours, and when the ratio c of the intersection area to the area of ​​the contour with the smaller area is greater than a preset overlap threshold, eliminates the circumscribed polygonal contour with the smaller area; S52, for the circumscribed polygonal contours remaining after elimination in step S51, calculates the height overlap ratio d of any two circumscribed polygonal contours in the z-axis direction, and the distance r between the center points of the corresponding two circumscribed polygonal contours; when d is greater than the preset vertical overlap ratio threshold, and r is less than the preset threshold R1, and c is greater than the preset minimum overlap ratio threshold, it is determined that the corresponding two circumscribed polygonal contours intersect; S53, for For two circumscribed polygonal contours that are judged to be intersecting, count the vertices of the circumscribed polygonal contour with a smaller area outside the circumscribed polygonal contour with a larger area, and reorder the vertices of the circumscribed polygonal contours with the smaller area and the larger area in a clockwise direction to obtain a merged circumscribed polygonal contour; S54, for the circumscribed polygonal contours remaining after being eliminated in step S51, when the distance r between the center points of any two circumscribed polygonal contours is less than a preset threshold R1, the overlap area ratio c is equal to 0, and the height overlap ratio d is greater than a preset threshold, the two circumscribed polygonal contours are judged to be adjacent; S55, for two circumscribed polygonal contours that are judged to be adjacent, count all the vertices of the circumscribed polygonal contour with a smaller area and all the vertices of the circumscribed polygonal contour with a larger area, and reorder them in a clockwise direction to obtain a merged circumscribed polygonal contour; S56, repeat steps S52 to S55 until all circumscribed polygonal contours are merged, and the obtained circumscribed polygonal contour is used as the final contour of the obstacle.

[0028] Furthermore, the merged circumscribed polygonal outline is obtained by re-arranging in a clockwise direction, including: calculating the coordinates of the geometric center point of the obstacle circumscribed polygonal outline as a reference point; traversing two adjacent vertices according to the original order of the vertex set of the obstacle circumscribed polygonal outline, and calculating two vectors formed by the two adjacent vertices and the reference point; performing a cross product operation on the two vectors to obtain a cross product result vector; judging the relationship between the direction of the cross product result vector and the direction of the plane normal vector of the obstacle circumscribed polygonal outline; if the cross product result vector is consistent with the direction of the normal vector, then judging that the connection direction of the two adjacent vertices is clockwise, otherwise it is counterclockwise; if the modulus of the cross product result vector is equal to 0, then judging that the two adjacent vertices are collinear with the reference point; according to the judgment result, adjusting the arrangement order of the vertex set of the obstacle circumscribed polygonal outline; if the connection direction of the adjacent vertices is counterclockwise, then exchanging the positions of the corresponding two vertices in the vertex set; repeating the above steps until all adjacent vertex pairs are traversed.

[0029] 3. Beneficial effects

[0030] Compared with the existing technology, the advantages of this application are:

[0031] By performing noise analysis and uniform downsampling on the obstacle point cloud, outliers and redundant points are removed from the point cloud data, reducing the data size for subsequent contour calculations and improving computational efficiency. Furthermore, downsampling preserves the geometric features of the obstacle point cloud, laying the foundation for subsequent accurate obstacle contour extraction.

[0032] Based on the obstacle point cloud, the system computes an AABB bounding box outline and adaptively chooses whether to further refine the polygonal outline. For small, regularly shaped obstacles, the bounding box outline is directly used as an approximate representation, avoiding unnecessary computational overhead. For larger, irregularly shaped obstacles, the polygonal outline is further extracted for a more accurate representation. This strategy adaptively selects the outline representation method based on the obstacle's characteristics, balancing computational efficiency and representation accuracy, thereby improving the system's real-time performance and reliability.

[0033] When calculating the polygonal outline, the AABB bounding box is rotated and its intersections are calculated, using a spatial indexing algorithm to efficiently find the closest intersection point to the obstacle point cloud. This method avoids the computational cost of a brute-force search for the closest point, significantly improving the efficiency of outline extraction. Furthermore, by extracting and sorting the set of closest intersection points, a compact and regular polygonal outline is obtained, reducing the number of vertices and simplifying the outline's complexity.

[0034] The resulting circumscribed polygonal outlines are then simplified and vertex angles calculated, and intersecting and adjacent polygonal outlines are merged. By merging coplanar or adjacent polygonal outlines, the number and complexity of obstacle outlines are further reduced, resulting in a more concise and standardized final obstacle outline. Furthermore, the number of vertices in the simplified outline is significantly reduced, reducing the computational burden of subsequent path planning and obstacle avoidance decisions. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The present application will be further described in the form of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting, and in these embodiments, the same numbers represent the same structures, wherein:

[0036] Figure 1 is an exemplary flow chart of a method for calculating obstacle contours in autonomous driving of underground mines according to some embodiments of the present application;

[0037] Figure 2 is an exemplary flow chart of an algorithm for calculating the outline of a polygonal bounding box according to some embodiments of the present application;

[0038] Figure 3 This is a calculation effect diagram of the polygonal contour of an underground mine shown in some embodiments of the present application;

[0039] Figure 4 is an exemplary flow chart of a polygon outline merging algorithm according to some embodiments of the present application;

[0040] Figure 5 This is a polygon outline merging effect diagram shown in some embodiments of the present application. DETAILED DESCRIPTION

[0041] The method and system provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0042] Figure 1This is an exemplary flow chart of a method for calculating the outline of an obstacle in an autonomous driving underground mine according to some embodiments of the present application, a method for calculating the outline of an obstacle in an autonomous driving underground mine, comprising: S1, obtaining clustered obstacle point cloud data; S2, judging whether it is a noise point based on the number of points in the obtained obstacle point cloud data, and when the number of noise points is less than the noise threshold, no outline calculation is performed; for the obstacle point cloud that is not a noise point, the AABB bounding box outline is calculated by counting the number of point clouds and uniformly downsampling the point clouds, and the length, width, center point and rotation angle of the bounding box matrix are obtained; S3, according to the calculation The obtained length and width of the AABB bounding box outline and the distance from the corner point of the bounding box to the obstacle point are used to determine whether the preset polygon outline calculation conditions are met; S4, when it is determined that the polygon outline calculation conditions are met, the calculated AABB bounding box outline is rotated and the intersection is calculated, and the intersection point closest to the obstacle point cloud is found by establishing a ktree index and sorting the intersection points to obtain the circumscribed polygon outline of the obstacle; S5, the obtained circumscribed polygon outline is calculated. The angles between adjacent points and the point simplification are performed to obtain the downsampled polygon outline as the final outline of the obstacle.

[0043] Figure 2 This is an exemplary flow chart of an algorithm for calculating polygonal bounding box outlines according to some embodiments of the present application. The algorithm primarily includes the following steps: Before calculating the polygonal outline of an obstacle, it is necessary to determine whether polygonal outline calculation is necessary. Because polygonal outline calculation is relatively complex and time-consuming, if the obstacle's shape and size meet certain requirements, its rectangular bounding box can be used directly as an approximate outline, thereby improving computational efficiency.

[0044] The conditions for determining whether polygon contour calculation is required are shown by the formula: L < L_threshold and W < W_threshold and D < D_threshold. Here, L represents the length of the rectangular bounding box of the obstacle, W represents the width, and D represents the maximum distance from the corner points of the bounding box to the obstacle points inside the bounding box. L_threshold, W_threshold, and D_threshold represent the length threshold, width threshold, and distance threshold respectively, which are constants preset according to specific application scenarios and requirements. The specific steps for the determination are as follows: Calculate the rectangular bounding box of the obstacle. For the given obstacle point cloud, first find its minimum and maximum x and y coordinates in the XOY plane to form the four vertices of the rectangular bounding box, and calculate the length L and width W of the rectangular bounding box. Calculate the distance from the corner points of the bounding box to the obstacle points. For the four corner points of the rectangular bounding box, calculate their distances to all the obstacle points inside the bounding box, and select the maximum distance as D. Determine whether the conditions are met. Compare the calculated L, W, and D with the preset thresholds. If L < L_threshold, W < W_threshold, and D < D_threshold are all satisfied simultaneously, it is considered that the shape and size of the obstacle are relatively regular, and the rectangular bounding box can be directly used as its approximate contour without further calculating the polygon contour. Perform subsequent processing according to the determination result. If the conditions are met, take the rectangular bounding box as the contour of the obstacle and add it to the contour set; if the conditions are not met, perform polygon contour calculation on the obstacle point cloud to obtain a more accurate contour representation. By determining whether polygon contour calculation is required, unnecessary complex calculations for small obstacles with regular shapes can be avoided, improving the efficiency of contour extraction. At the same time, for obstacles with irregular shapes or large sizes, accurate contour representations are still obtained through polygon contour calculation, ensuring the reliability of the perception and planning of autonomous vehicles.

[0045] Calculate the intersection between the rotated bounding box and the main bounding box, and sort the intersections in a clockwise direction to obtain the circumscribed polygonal outline of the obstacle point cloud. First, rotate the bounding box according to the preset angle threshold θ. The selection of the angle threshold θ needs to take into account the shape characteristics of the obstacle and the accuracy of the required outline. Generally, common angles such as 15°, 30°, and 45° can be selected. The rotated bounding box is called a rotated bounding box. Then, calculate the intersection between the rotated bounding box and the main bounding box. The main bounding box refers to the original bounding box that has not been rotated. The specific steps for calculating the intersection are as follows: Calculate the equations of the lines where the four sides of the rotated bounding box and the main bounding box are located respectively. Suppose the four vertices of the rotated bounding box are (x1, y1), (x2, y2), (x3, y3), and (x4, y4), and the four vertices of the main bounding box are (x1, Y1), (x2, Y2), (x3, Y3), and (x4, Y4). The equations of the lines on which their edges are located can be expressed as follows: Rotated bounding box: (y-y1)=k1*(x-x1), k1=(y2-y1) / (x2-x1); (y-y2)=k2*(x-x2), k2=(y3-y2) / (x3-x2); (y-y3)=k3*(x-x3), k3=(y4-y3) / (x4-x3); (y-y4)=k4*(x-x4), k4=(y1-y4) / (x1-x4).

[0046] Main bounding box: (Y-Y1) = K1*(X-X1), K1=0; (Y-Y2) = K2*(X-X2), K2=0; (Y-Y3) = K3*(X-X3), K3=∞; (Y-Y4) = K4*(X-X4), K4=∞.

[0047] Calculate the intersection of each edge of the rotated bounding box with each edge of the main bounding box. Using the intersection formula for two lines, we can obtain: X = (k1*x1-y1-K1*X1+Y1) / (k1-K1); Y = k1*(X-x1)+y1. Here, k1 and K1 represent the slopes of the lines along which the edges of the rotated and main bounding boxes lie, respectively. For each edge of the rotated bounding box, calculate the intersection with each of the four edges of the main bounding box, resulting in a maximum of eight intersections. Determine whether the intersection is on an edge of the rotated and main bounding boxes. For each calculated intersection point, it is necessary to determine whether it satisfies the following conditions at the same time: min(x1, x2) ≤ X ≤ max(x1, x2); min(y1, y2) ≤ Y ≤ max(y1, y2); min(X1, X2) ≤ X ≤ max(X1, X2); min(Y1, Y2) ≤ Y ≤ max(Y1, Y2); If the intersection point satisfies the above conditions, it is considered to be a valid intersection point, otherwise the intersection point is discarded.

[0048] Sort the valid intersections in a clockwise direction. You can calculate the angle of the intersection relative to the center of the rotated bounding box based on its coordinates, and then sort the intersections in ascending order. Let's assume the coordinates of the center of the rotated bounding box are (cx, cy) and the coordinates of the intersection are (X, Y). The angle θ of the intersection relative to the center can be expressed as: θ = atan2(Y - cy, X - cx); where atan2 is the inverse tangent function, which calculates the angle based on the given y and x coordinates. Sorting the intersections in ascending order of angle θ yields a clockwise sequence of intersections.

[0049] It is necessary to extract the circumscribed polygon vertices of the obstacle point cloud from the intersection of the rotated bounding box and the main bounding box, and sort the vertices in a clockwise direction to obtain the final polygon outline. First, establish a k-tree spatial index for the obstacle point cloud. K-tree is a commonly used spatial index data structure that can quickly find the nearest neighbor points of a given point. Specifically, the obstacle point cloud is divided into multiple subspaces, each subspace corresponds to a node of the k-tree, and the subspace is recursively divided until the number of points in the subspace is less than or equal to a preset threshold. When searching, starting from the root node, recursively search the subspace for the point closest to the query point until the nearest neighbor point is found or a leaf node is searched. Then, for each intersection of the rotated bounding box and the main bounding box, search the k-tree index for the obstacle point cloud point closest to the intersection.

[0050] The search steps are as follows: Calculate the distance between the intersection and all points in the k-tree index. Assume the coordinates of the intersection are (x, y) and the coordinates of the point in the k-tree index are (xi, yi). The distance di between them can be expressed as: di = sqrt((x - xi)^2 + (y - yi)^2), where sqrt represents the square root function. Search the k-tree index for the point closest to the intersection. Starting from the root node of the k-tree, recursively search the subspace for the point closest to the intersection until the nearest neighbor is found or a leaf node is reached. During the search, record the nearest point found and its distance. Use the nearest neighbor as a vertex of the circumscribed polygon. For each intersection point, use its nearest neighbor found in the k-tree index as a vertex of the circumscribed polygon and save it in the vertex set. Repeat until all intersection points have corresponding nearest neighbors, resulting in a complete vertex set. Finally, sort the extracted vertices in a clockwise direction. Vertices can be sorted based on their angle relative to the center point of the obstacle point cloud, using a similar sorting method as in step 2. Assuming the coordinates of the center point of the obstacle point cloud are (cx, cy) and the coordinates of the vertices are (xi, yi), the angle θi of the vertex relative to the center point can be expressed as: θi = atan2(yi-cy, xi-cx), where atan2 is the inverse tangent function, which can calculate the angle based on the given y and x coordinates. Sorting the vertices in ascending order according to the angle θi yields a clockwise sequence of vertices for the circumscribed polygon. By extracting the vertices of the circumscribed polygon and sorting them in a clockwise direction, an accurate outline representation of the obstacle point cloud can be obtained. Compared to directly using the intersection of the rotated bounding box, the outline obtained by this method better fits the actual shape of the obstacle and has higher accuracy. At the same time, due to the use of a k-tree spatial index, the process of finding the nearest neighbor point is also very efficient and can meet real-time requirements.

[0051] After obtaining the vertices of the circumscribed polygon of the obstacle point cloud, some vertices may be duplicated or redundant, resulting in a complex contour. To further simplify the contour, the vertices need to be downsampled. First, consider the three adjacent vertices P1 (x1, y1), P2 (x2, y2), and P3 (x3, y3) in a clockwise direction. Calculate the angles α1 and α2 between the two vectors v1 and v2 formed by P1, P2, and P3. The specific calculation formulas are as follows: v1 = (x2 - x1, y2 - y1); v2 = (x3 - x2, y3 - y2); α1 = atan2 (v1.y, v1.x); α2 = atan2 (v2.y, v2.x). Where atan2 is the inverse tangent function, which calculates the angle based on the given y and x coordinates. Then, determine whether the absolute value of the difference between the angles α1 and α2 is less than the preset angle threshold δ, that is, |α1 - α2| < δ; where |x| represents the sign of the absolute value. The angle threshold δ needs to be set based on the specific application scenario and requirements. Typically, smaller angles such as 5°, 10°, or 15° are chosen. If the absolute value of the angle difference is less than the angle threshold δ, vertex P2 is considered to be omitable, and vertices P1 and P3 are used to form a contour edge. Specifically, vertex P2 is removed from the vertex sequence, and vertex P3 is used as the starting point for the next judgment, continuing to consider the two vertices after it. This process is repeated, successively determining the angle difference between three adjacent vertices and removing any intermediate vertices that can be omitted until one of the following two conditions is met: the number of vertices in the simplified contour is less than or equal to a preset vertex count threshold b. The vertex count threshold b should be selected based on a comprehensive consideration of contour accuracy and complexity. Typically, a smaller value such as 10, 20, or 30 is chosen. No more intermediate vertices can be omitted, meaning that the angle difference between all three adjacent vertices is greater than or equal to the angle threshold δ. When either of these conditions is met, the vertex simplification process is terminated, resulting in the final simplified contour. Downsampling and simplification of the circumscribed polygon vertices effectively reduces contour complexity and improves contour representation efficiency. The simplified outline has fewer vertices while maintaining the original shape features, making it more suitable for subsequent tasks such as obstacle recognition, tracking, and planning.

[0052] Figure 3 The application effect of the polygon contour calculation algorithm proposed in this application in an actual underground mine environment is demonstrated. In the figure, the green rectangle represents the outline of the autonomous driving vehicle, the blue, purple and green irregular polygons represent the walls of the underground mine tunnel, and the yellow polygon represents the obstacle vehicle in front. Figure 3As can be seen, the walls on both sides of the underground mine tunnel are long, exceeding 5 meters in length. Traditional rectangular bounding box algorithms are ineffective in representing the outline of such slender obstacles, creating a large amount of redundant space, causing the outline to protrude significantly and occupying the vehicle's drivable area. However, the polygonal outline calculation algorithm proposed in this application can effectively conform to the actual shape of the wall, generating a compact, regular polygonal outline.

[0053] As can be seen from the polygonal outline of the wall in the figure, the contour line is highly consistent with the actual edge of the wall, and the raised part of the contour basically does not occupy the vehicle's drivable area. This is due to the fact that the algorithm fully utilizes the spatial distribution characteristics of the obstacle point cloud when extracting the circumscribed polygon vertices. By calculating the intersection of the rotating bounding box and the main bounding box, and searching the nearest point using k-tree, more accurate and fitting contour vertices are obtained. At the same time, the algorithm simplifies the extracted contour vertices, removes redundant and repeated vertices, and further improves the compactness of the contour. For the obstacle vehicle in front, the algorithm of this application can also generate a reasonable polygonal contour. Compared with the wall, the obstacle vehicle is smaller in size and more regular in shape. The algorithm adaptively chooses whether to perform polygonal contour extraction based on the characteristics of the obstacle. For smaller obstacles, a simpler rectangular bounding box representation is directly used to avoid unnecessary computational overhead.

[0054] Figure 3 The actual application results show that the polygonal contour calculation algorithm of this application can accurately and efficiently extract the compact contours of obstacles in the complex environment of underground mines. The generated polygonal contour can fit the actual shape of the obstacle to the greatest extent possible, reduce the raised part of the contour, and ensure that the drivable area of ​​the autonomous driving vehicle is not affected. This provides reliable environmental perception data for the vehicle's trajectory planning and obstacle avoidance decisions, improves the safety and reliability of the autonomous driving system, and ensures the normal implementation of the autonomous driving function. The algorithm comprehensively considers the accuracy and computational efficiency of contour extraction, and is a practical contour calculation method suitable for autonomous driving scenarios in underground mines.

[0055] This application proposes a polygon overlap, intersection and proximity optimization algorithm for the problem where a single obstacle is identified as multiple contours. Figure 4This is an exemplary flowchart of a polygon outline merging algorithm according to some embodiments of the present application. The algorithm primarily includes the following steps: To filter out overlapping polygon outlines, the extracted polygon outlines must first be projected onto the XOY plane. This step can be achieved by converting the three-dimensional coordinates (x, y, z) of the polygon outlines into two-dimensional coordinates (x, y). Specifically, the z coordinates of the polygon outline vertices are ignored, retaining only the x and y coordinates, to obtain the projection of the polygon outline onto the XOY plane. Next, the intersection area between any two polygon groups is calculated. For N polygon outlines, C(N, 2) pairwise combinations are performed to calculate the intersection area for each pair of polygon outlines. This intersection area calculation can be achieved using computational geometry algorithms, including common ones such as the scanline algorithm and polygon decomposition. Using the scanline algorithm as an example, for two polygons P1 and P2, their minimum and maximum Y-axis coordinates are first determined. Then, starting from the minimum coordinate, the line-by-line scan is performed, calculating the intersection point between P1 and P2 on each line. Based on the parity of the intersection points, it is possible to determine which line segments on the current scanline belong to the intersection area. By adding up the lengths of the intersecting line segments on all scan lines, we can get the intersection area S of P1 and P2.

[0056] After calculating the intersection area S, we need to determine whether its ratio (c) to the area of ​​one of the polygon outlines exceeds a preset overlap threshold. Assuming the area of ​​P1 is A1 and the area of ​​P2 is A2, the ratio c can be expressed as: c = S / min(A1, A2), where min(A1, A2) represents the smaller of A1 and A2. If the ratio c exceeds the preset overlap threshold (for example, 0.8), the two polygon outlines are considered to have a high degree of overlap and require filtering. The principle of filtering is to retain more appropriate contours and remove those with high overlap. Contour suitability can be assessed based on the following factors: Area size: Generally, polygon outlines with larger areas contain more information and should be retained first. Positional relationship: Consider the positional relationship of the polygon outlines in 3D space. If one contour is completely inside another, the inner contour should be removed. Contour shape: More regular, simple polygon outlines are generally more suitable for approximating obstacles and should be retained first. Taking all these factors into consideration, the most appropriate polygon outlines are retained, while contours with high overlap are filtered out.

[0057] For any two polygonal outlines, we need to determine whether they intersect and, if so, merge them. The criteria for determining intersection include three aspects: the vertical height overlap ratio d, the distance r between the polygon centers, and the overlapping area ratio c. First, calculate the vertical height overlap ratio d of the two polygonal outlines. Let z1_min and z1_max be the minimum and maximum z coordinates of the first polygonal outline, and z2_min and z2_max be the minimum and maximum z coordinates of the second polygonal outline. The vertical height overlap ratio d can be expressed as: d = (min(z1_max, z2_max) - max(z1_min, z2_min)) / (max(z1_max, z2_max) - min(z1_min, z2_min)), where min(z1_max, z2_max) represents the maximum vertical height overlap of the two polygonal outlines, max(z1_min, z2_min) represents the minimum vertical height overlap, and the denominator represents the total vertical height of the two polygonal outlines.

[0058] Next, calculate the distance r between the center points of the two polygonal contours. Assume the coordinates of the center point of the first polygonal contour are (x1, y1) and the coordinates of the center point of the second polygonal contour are (x2, y2). The distance r can be expressed as: r = sqrt((x1-x2)^2 + (y1-y2)^2), where sqrt represents the square root function. Finally, calculate the overlap ratio c of the two polygonal contours using the same calculation method as in step 1. If d is greater than a preset vertical overlap ratio threshold (e.g., 0.8), r is less than a preset distance threshold (e.g., 1 meter), and c is greater than a minimum overlap ratio threshold (e.g., 0.2), the two polygonal contours are considered to intersect and need to be merged. The specific merging method first determines the area of ​​the two polygonal contours, identifying the smaller and larger contours. Then, count the vertices of the smaller polygonal contour that are outside the larger polygonal contour. This can be achieved by calculating the shortest distance from each vertex to the larger contour. If the shortest distance is greater than a threshold (e.g., 0.1 meter), the vertex is considered to be outside the larger contour. Merge the vertices of the smaller polygonal contour outside the larger contour with the vertices of the larger contour to form a new set of vertices. This set of vertices is then reordered according to a specific rule, such as in counterclockwise order, to create a new merged contour. The relevant parameters are calculated as follows: d = (min(z1_max, z2_max) - max(z1_min, z2_min)) / (max(z1_max, z2_max) - min(z1_min, z2_min)); r = sqrt((x1-x2)^2 + (y1-y2)^2); and c = S / min(A1, A2). S represents the intersecting area of ​​the two polygonal contours, and A1 and A2 represent the areas of the two polygonal contours, respectively. By merging intersecting polygonal contours, a more accurate and concise obstacle contour representation can be obtained. The merged contour better reflects the actual shape and location of the obstacle, reducing contour redundancy and discontinuity caused by over-segmentation. This is crucial for improving the perception and decision-making capabilities of autonomous vehicles.

[0059] For any two polygonal outlines, we need to determine whether they are adjacent. If so, we merge them. The criteria for determining proximity include three aspects: the distance r between the polygon center points, the overlap ratio, and the height overlap ratio d. First, we calculate the distance r between the center points of the two polygonal outlines using the following formula: r = sqrt((x1 - x2)^2 + (y1 - y2)^2), where (x1, y1) and (x2, y2) represent the coordinates of the center points of the two polygonal outlines, respectively. Next, we calculate the overlap ratio of the two polygonal outlines. This requires that the overlap ratio be zero, meaning that the two polygonal outlines do not intersect in the XOY plane. Finally, calculate the vertical overlap ratio d of the two polygonal outlines. The calculation method is the same as in step 2: d = (min(z1_max, z2_max) - max(z1_min, z2_min)) / (max(z1_max, z2_max) - min(z1_min, z2_min)). If r is less than a preset threshold R1 (e.g., 1 meter), the overlap ratio is 0, and d is greater than a preset threshold (e.g., 0.8), the two polygonal outlines are considered adjacent and need to be merged. The specific merging method first determines the area of ​​the two polygonal outlines and identifies the smaller and larger outlines. Then, count the vertices of the smaller and larger outlines to obtain a new set of vertices. This set of vertices is rearranged according to a certain rule to obtain the merged new polygonal outline.

[0060] Common arrangement rules include: Arrange vertices in counterclockwise order to ensure that the merged contour remains a valid polygon. Arrange vertices in ascending z-coordinate order to ensure vertical continuity of the merged contour. Arrange vertices in ascending distance from the center of the polygon to ensure a relatively regular shape of the merged contour. You can choose the appropriate arrangement rule based on the specific application scenario and requirements. By merging adjacent polygonal contours, the obstacle contour representation can be further simplified, reducing the number and complexity of contours. This helps improve the perception and planning efficiency of autonomous vehicles and reduces computing resource consumption. Simplify the merged polygonal contour. The new merged polygonal contour is processed using a similar downsampling simplification method as described above. Calculate the change in the angle between two adjacent vertices along the order of the vertices. If the change in angle is less than a preset threshold, one of the vertices can be omitted, thereby simplifying the contour. Repeat this process until the number of vertices in the simplified contour is less than a preset threshold b.

[0061] Figure 5 Polygon wheel contour merging effect,After obtaining the polygonal contours of the obstacle, there may be some overlapping or similar contours, which need to be merged. Figure 5This is a polygonal contour merging effect diagram according to some embodiments of the present application, demonstrating the effect of polygon contour merging. Red represents the obstacle vehicle ahead, and green represents multiple polygon contours before merging. First, for each polygon contour to be merged, the overlap ratio with the obstacle vehicle outline ahead (red contour) is calculated. Specifically, the degree of overlap between two polygon contours can be measured using the Intersection over Union (IoU) ratio. Let the green polygon contour be A and the red polygon contour be B. Their Intersection over Union (IoU) can be expressed as: IoU(A, B) = Area(A∩B) / Area(A∪B); where A∩B represents the intersection area of ​​the two polygons, A∪B represents the union area of ​​the two polygons, and Area(·) represents the area of ​​the calculated polygon. The IoU value range is [0, 1], with larger values ​​indicating a higher degree of overlap between the two polygon contours. When the IoU exceeds the preset threshold C, the green polygon contour is considered to have a high degree of overlap with the red polygon contour and needs to be merged. The threshold C needs to be set according to the specific application scenario and requirements. Typically, a higher value such as 0.5, 0.6, or 0.7 can be selected. For each green polygon outline, its IoU value with the red polygon outline is calculated to determine whether it is greater than the threshold C. If the IoU is greater than the threshold C, the green polygon outline is marked as a contour to be merged.

[0062] Then, all green polygon outlines to be merged are filtered, retaining only the red polygon outlines as the final obstacle outlines. Specifically, all green polygon outlines are iterated over and removed from the outline set. After deletion, only the red polygon outlines remain in the outline set, representing the merged obstacle outlines. The polygon outline merging algorithm effectively filters out duplicate or similar obstacle outlines, resulting in a more accurate and concise obstacle representation. The merged outlines better reflect the true location and shape of the obstacle, reduce redundant information, and improve the efficiency of obstacle perception and decision-making.

[0063] by Figure 5 For example, the IoU values ​​of green polygonal contours A and B with red polygonal contour C are calculated as follows: IoU(A, C) = 0.8; IoU(B, C) = 0.7. Assuming threshold C is set to 0.6, both green polygonal contours A and B meet the merging criteria. A and B are removed from the contour set, leaving only red polygonal contour C as the final obstacle contour. This simplified obstacle representation is achieved through the polygonal contour merging algorithm, improving the accuracy and efficiency of environmental perception and autonomous driving decision-making.

Claims

1. A method for calculating obstacle contours in an underground mine automatic driving system, comprising: S1, obtain the clustered obstacle point cloud data; S2: Determine whether the obstacle point cloud data is noise based on the number of points. If the number of noise points is less than the noise threshold, no contour calculation is performed. For non-noise obstacle point clouds, the AABB bounding box contour is calculated by counting the number of point clouds and uniformly downsampling the point clouds to obtain the length, width, center point, and rotation angle of the bounding box matrix. S3, judging whether the preset polygon outline calculation conditions are met based on the calculated length and width of the AABB bounding box outline and the distance from the bounding box corner point to the obstacle point; S4, when it is determined that the polygonal contour calculation conditions are met, the calculated AABB bounding box contour is rotated and the intersection is calculated. The intersection point closest to the obstacle point cloud is found by establishing a ktree index and the intersection points are sorted to obtain the circumscribed polygonal contour of the obstacle; S5, calculating the angles between adjacent points and simplifying the points on the obtained circumscribed polygonal contour to obtain a downsampled polygonal contour as the final contour of the obstacle, including: S51, projecting the multiple obstacle circumscribed polygonal contours obtained in step S4 onto the XOY plane, calculating the intersection area of ​​any two circumscribed polygonal contours; comparing the intersection area with the area of ​​the smaller of the two circumscribed polygonal contours; and when the ratio c of the intersection area to the area of ​​the smaller contour is greater than a preset overlap threshold, eliminating the circumscribed polygonal contour with the smaller area; S52: For the circumscribed polygonal contours remaining after being eliminated in step S51, calculate the height overlap ratio d of any two circumscribed polygonal contours in the z-axis direction, and the distance r between the center points of the two corresponding circumscribed polygonal contours; when d is greater than a preset vertical overlap ratio threshold, r is less than a preset threshold R1, and c is greater than a preset minimum overlap ratio threshold, determine that the two corresponding circumscribed polygonal contours intersect; S53: For the two circumscribed polygonal contours determined to be intersecting, count the vertices of the circumscribed polygonal contour with the smaller area that are outside the circumscribed polygonal contour with the larger area, and reorder the vertices of the circumscribed polygonal contours with the smaller area and the larger area in a clockwise direction to obtain a merged circumscribed polygonal contour; S54, for the circumscribed polygonal contours remaining after being eliminated in step S51, when the distance r between the center points of any two circumscribed polygonal contours is less than a preset threshold R1, the overlap area ratio c is equal to 0, and the height overlap ratio d is greater than a preset threshold, the two circumscribed polygonal contours are determined to be adjacent; S55, for the two circumscribed polygonal contours determined to be adjacent, counting all vertices of the circumscribed polygonal contour with a smaller area and all vertices of the circumscribed polygonal contour with a larger area, and reordering them in a clockwise direction to obtain a merged circumscribed polygonal contour; S56, repeating steps S52 to S55 until all circumscribed polygonal outlines are merged, and the obtained circumscribed polygonal outline is used as the final outline of the obstacle.

2. The method for calculating obstacle contours in automatic driving of underground mines according to claim 1, characterized in that: S2, based on the number of points in the obtained obstacle point cloud data, determines whether it is a noise point. For non-noise obstacle point clouds, calculate the AABB bounding box contour, including: S21, obtaining the number of points in the clustered obstacle point cloud, and comparing the number of points in the point cloud with a preset noise threshold a; when the number of points in the point cloud is less than the noise threshold a, the corresponding point cloud is determined to be a noise point, and subsequent contour calculation is not performed; when the number of points in the point cloud is greater than or equal to the noise threshold a, the corresponding point cloud is determined to be a non-noise point; S22, for the point cloud determined as non-noise points in step S21, the corresponding point count is compared with a preset downsampling threshold b; if the point count of the point cloud is less than the downsampling threshold b, step S24 is directly executed; otherwise, the corresponding point cloud is downsampled using a uniform downsampling algorithm; S23, for the point cloud obtained by the uniform downsampling process in step S22, the angle between any two corresponding points in the point cloud is calculated, and the direction with the largest angle is obtained as the direction of the bounding box; S24, based on the direction of the bounding box, the original obstacle point cloud determined as non-noise in step S21 is rotated and transformed so that the direction of the obstacle point cloud is consistent with the direction of the bounding box; an AABB bounding box is generated for the point cloud after the rotation transformation, and the length, width, center point coordinates and rotation angle of the bounding box matrix are updated to obtain the updated AABB bounding box outline.

3. The method for calculating obstacle contours in automatic driving of underground mines according to claim 2, characterized in that: S22: When the number of points in the point cloud is less than the downsampling threshold b, directly execute step S24, including: For the point cloud determined as non-noise points in step S21, the corresponding number of points is compared with the preset downsampling threshold b; When the number of points in the point cloud is less than the downsampling threshold b, calculate the covariance matrix of the corresponding point cloud; Perform eigenvalue decomposition on the covariance matrix, take the eigenvector with the largest eigenvalue as the main direction of the point cloud, and then directly execute step S24.

4. The method for calculating obstacle contours in an underground mine automatic driving according to claim 2, characterized in that: S22, using a uniform downsampling algorithm to downsample the corresponding point cloud, including: Determine the target resolution of uniform downsampling based on the density of the original obstacle point cloud; Perform 3D spatial division on the original obstacle point cloud, dividing the point cloud into multiple cube grids of equal size, with the side length of each grid equal to the target resolution; Traverse each point in the original obstacle point cloud and determine the cube grid to which each point belongs based on the coordinate value; Count the number of points in the original obstacle point cloud contained in each cube grid; if the number of points is greater than or equal to 1, calculate the average coordinate value of all points in the grid as the representative point of the grid; if the number of points is equal to 0, do not generate a representative point in the downsampled point cloud; The representative points of all grids are used as the downsampled obstacle point cloud.

5. The method for calculating obstacle contours in automatic driving of underground mines according to claim 3, characterized in that: S24, update the AABB bounding box outline, including: Calculate the angle between the bounding box direction obtained in step S23 and the main direction of the original obstacle point cloud as the rotation transformation angle; Constructing a rotation transformation matrix based on the rotation transformation angle, performing a rotation transformation on each point in the original obstacle point cloud determined as a non-noise point in step S21, to obtain a rotationally transformed obstacle point cloud; According to the obstacle point cloud after rotation transformation, calculate the minimum and maximum values ​​in the X-axis, Y-axis and Z-axis directions, and update the length, width and height of the AABB bounding box; Calculate the geometric center coordinates of the obstacle point cloud after rotation transformation as the center coordinates of the updated AABB bounding box; Use the rotation transformation angle as the rotation angle of the updated AABB bounding box; Construct the updated AABB bounding box outline based on the length, width, center point coordinates and rotation angle of the updated AABB bounding box.

6. The method for calculating obstacle contours in automatic driving of underground mines according to claim 1, characterized in that: S3, based on the calculated length and width of the AABB bounding box outline and the distance from the bounding box corner point to the obstacle point, determines whether the preset polygon outline calculation conditions are met, including: Determine whether the length of the AABB bounding box outline obtained in step S2 is less than a preset length threshold, whether the width is less than a preset width threshold, and whether the distance from the AABB bounding box corner point to the obstacle point cloud is less than a preset distance threshold; if all three conditions are met, execute step S4; otherwise, use the AABB bounding box outline obtained in step S2 as the final outline of the obstacle.

7. The method for calculating obstacle contours in automatic driving of underground mines according to claim 1, characterized in that: S4: When the polygonal contour calculation conditions are met, the calculated AABB bounding box contour is rotated and the intersection is calculated. The intersection closest to the obstacle point cloud is found by establishing a ktree index and the intersections are sorted to obtain the circumscribed polygonal contour of the obstacle, including: S41, rotating the AABB bounding box contours that meet the polygon contour calculation conditions in step S3 according to a preset angle threshold, to obtain a plurality of rotated bounding boxes; S42, calculating the intersection of each rotated bounding box and the original AABB bounding box to obtain an intersection set, and sorting all the intersections in the intersection set in a clockwise direction to obtain a sorted intersection set; S43, using the ktree algorithm to establish an index of the sorted intersection set, traversing each intersection in the sorted intersection set, searching for the intersection closest to the non-noise obstacle point cloud in step S2 through the index, and extracting all the closest intersections to form a closest intersection set; S44, sorting the closest intersection point set in a clockwise direction to obtain a sorted closest intersection point set, and connecting the sorted closest intersection point set to form a closed obstacle circumscribed polygonal outline; S45. Calculate the included angle of three adjacent vertices in the obstacle circumscribed polygonal outline. If the included angle is greater than a preset simplified angle threshold, retain the two end vertices, remove the middle vertex, and update the obstacle circumscribed polygonal outline. Repeat the vertex removal process until the number of vertices in the obstacle circumscribed polygonal outline is less than a preset point count threshold b. The downsampled and simplified obstacle circumscribed polygonal outline is obtained as the final obstacle circumscribed polygonal outline.

8. The method for calculating obstacle contours in automatic driving of underground mines according to claim 7, characterized in that: S43, using the ktree algorithm to establish an index of the sorted intersection set, traversing each intersection in the sorted intersection set, searching for the intersection closest to the non-noise obstacle point cloud in step S2 through the index, extracting all the closest intersections to form a closest intersection set, including: The sorted intersection point set obtained in step S42 is spatially partitioned using the octree algorithm, recursively dividing the three-dimensional space into eight sub-regions of equal size, until the number of intersection points in each sub-region is less than a preset segmentation threshold, or the size of the sub-region is less than a preset minimum size threshold; For each subregion divided by the octree algorithm, traverse the included intersections. For each intersection, use the K-nearest neighbor algorithm to search for the K obstacle points closest to the corresponding intersection in the non-noise obstacle point cloud obtained in step S2. Calculate the average distance from the corresponding intersection to the K nearest obstacle points, and use the intersection with the smallest average distance as the nearest intersection of the corresponding subregion. Traverse all sub-regions obtained by the octree algorithm, extract the nearest intersection point of each sub-region, and construct the nearest intersection point set according to the original order of the nearest intersection points in the sorted intersection point set; Downsample the nearest intersection set, calculate the distance between adjacent nearest intersections, and when the distance is less than the preset merge distance threshold, merge the two nearest intersections into one nearest intersection and update the nearest intersection set. Repeat the merge operation until the distance between any two nearest intersections in the nearest intersection set is greater than the merge distance threshold. The obtained set of nearest intersection points is used as the vertex set of the obstacle circumscribed polygonal outline, and the vertices are connected in the order of the vertices in the set of nearest intersection points to form a closed obstacle circumscribed polygonal outline.

9. The method for calculating obstacle contours in automatic driving of underground mines according to claim 1, characterized in that: Rearrange them in a clockwise direction to obtain the merged circumscribed polygon outline, including: Calculate the coordinates of the geometric center point of the obstacle's circumscribed polygonal outline as the reference point; According to the original order of the vertex set of the obstacle circumscribed polygon outline, traverse two adjacent vertices and calculate the two vectors formed by the two adjacent vertices and the reference point; Perform a cross product operation on two vectors to obtain a cross product result vector; Determine the relationship between the direction of the cross product result vector and the direction of the plane normal vector of the obstacle's circumscribed polygonal outline; If the cross product vector is in the same direction as the normal vector, the connection direction of the two adjacent vertices is judged to be clockwise, otherwise it is counterclockwise; If the modulus of the cross product vector is equal to 0, then the two adjacent vertices are judged to be collinear with the reference point; According to the judgment result, the arrangement order of the vertex set of the obstacle circumscribed polygon outline is adjusted; If the connection direction of adjacent vertices is counterclockwise, the positions of the two corresponding vertices in the vertex set are swapped; Repeat the above steps until all adjacent vertex pairs are traversed.

Citation Information

Patent Citations

  • Point cloud clustering and surrounding method based on binary occupancy grid

    CN114187425A

  • Obstacle contour determination method and device, equipment and storage medium

    CN114252886A