Obstacle contour calculation method in underground mine automatic driving

By using AABB bounding box and spatial indexing algorithms in an underground mine autonomous driving system, combined with noise detection and rotation transformation, the contours of obstacles in the underground mine environment are calculated. This solves the problem of low accuracy in obstacle contour calculation in existing technologies, achieves efficient and accurate obstacle extraction, and improves the safety and reliability of the autonomous driving system.

CN118982812AActive Publication Date: 2024-11-19LEIKE ZHITU (BEIJING) TECH CO LTD +1

Patent Information

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

AI Technical Summary

Technical Problem

In underground mine autonomous driving systems, existing obstacle contour calculation methods suffer from low accuracy. Especially in complex and ever-changing mining environments, traditional methods cannot accurately and in real time obtain the compact contours of obstacles, affecting the vehicle's obstacle avoidance and navigation performance.

Method used

By acquiring obstacle point cloud data, using AABB bounding box and spatial indexing algorithms, combined with noise detection, uniform downsampling and rotation transformation, the AABB bounding box contour is calculated. Then, the intersection point is found through ktree indexing, the circumscribed polygon contour is extracted, and the vertices are simplified to obtain the final contour of the obstacle.

Benefits of technology

It improves the accuracy and efficiency of obstacle contour calculation, generates compact and regular obstacle circumscribed polygon contours, reduces redundant calculations, and improves the real-time performance and reliability of autonomous driving systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982812A_ABST
    Figure CN118982812A_ABST
Patent Text Reader

Abstract

The invention discloses an obstacle contour calculation method in underground mine automatic driving, and relates to the field of unmanned driving, and the method comprises the steps: obtaining clustered obstacle point cloud data; judging whether the obstacle is a noisy point according to the point number of the obstacle point cloud data; for non-noisy obstacle point clouds, calculating an AABB bounding box contour by counting the number of the point clouds and performing uniform downsampling on the point clouds; according to the contour of the AABB bounding box, judging whether a preset polygon contour calculation condition is met or not; performing rotation and intersection point calculation on the calculated AABB bounding box contour, searching the intersection point closest to the obstacle point cloud by establishing a ktree index, and sorting the intersection points to obtain an external polygon contour of the obstacle; and performing included angle calculation between adjacent points and point simplification on the circumscribed polygon contour to obtain a final contour of the obstacle. Aiming at the low obstacle contour calculation precision in the underground mine automatic driving process in the prior art, the method improves the contour extraction precision while guaranteeing the 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 automatic driving in underground mines. Background Art

[0002] With the development of modern mines, the underground mine environment is becoming increasingly complex, and traditional manual driving methods can no longer meet the needs of safe and efficient production. In order to improve mining efficiency and ensure the safety of operators, autonomous driving technology has received widespread attention and application in underground mines. The underground mine autonomous driving system uses computer vision, navigation positioning, trajectory planning and motion control technologies to achieve autonomous navigation and obstacle avoidance of unmanned vehicles. In the complex and changing environment of underground mines, autonomous driving vehicles need to perceive the surrounding environment in real time, identify the location and shape of obstacles, and plan a safe and efficient driving path. Therefore, accurate and real-time acquisition of obstacle contour information is the key to environmental perception and decision-making planning of the autonomous driving system.

[0003] At present, the automatic driving system of underground mines mainly uses sensors such as laser radar to obtain environmental information, and extracts the outline of obstacles through point cloud data processing and analysis. However, due to the complexity and variability of underground mine tunnels and the vibration of moving vehicles, the obtained obstacle point cloud data varies greatly, which puts higher requirements on the outline extraction algorithm. Traditional obstacle outline representation methods, such as bounding sphere, AABB bounding box (axis-aligned bounding box) and OBB bounding box (oriented bounding box), have certain limitations when dealing with the complex environment of underground mines. The bounding sphere method is simple to calculate, but there is a large redundant space, especially for obstacles such as slender walls, the bounding sphere may even cover the entire drivable area, resulting in a large outline deviation. The AABB bounding box is simple to construct, but it will also produce a large redundant space and outline deviation for irregular obstacles and rotating obstacles. Although the OBB bounding box can represent the obstacle outline more compactly, it has high computational complexity and poor real-time performance. In addition, it is still difficult to achieve a close fit with the obstacle for large walls that are more than ten meters long. However, the generated obstacle contours are highly redundant and irregular in shape, especially for large moving obstacles, which seriously affects the rationality of autonomous vehicle trajectory planning and obstacle avoidance decisions, and reduces the smoothness and safety of vehicle operation. Therefore, there is an urgent need for an obstacle contour calculation method suitable for the complex environment of underground mines, which can quickly and accurately extract the compact contours of moving obstacles, provide high-quality environmental perception data for the autonomous driving system, and improve the vehicle's obstacle avoidance and navigation performance. Summary of the invention

[0004] 1. Technical issues to be solved

[0005] In response to the problem of low accuracy in obstacle contour calculation during autonomous driving in underground mines in the prior art, the present application provides a method for calculating obstacle contours in autonomous driving in underground mines, which 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 calculation 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 the outline of an obstacle in an automatic driving of an underground mine, comprising: S1, obtaining clustered obstacle point cloud data; S2, judging whether it is a noise point according to the number of points of the obtained obstacle point cloud data, and not performing outline calculation when the number of points of the noise point is less than the noise threshold; for the obstacle point cloud of non-noise point, calculating the outline of an AABB bounding box 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 outline calculation condition is met according to the length and width of the calculated AABB bounding box outline and the distance from the corner point of the bounding box to the obstacle point; S4, when it is judged that the polygon outline calculation condition is met, 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, and obtaining the circumscribed polygon outline of the obstacle; S5, calculating the angle between adjacent points and simplifying the points of the obtained circumscribed polygon outline, and obtaining the downsampled polygon outline as the final outline of the obstacle.

[0009] Among them, the clustered obstacle point cloud data: point cloud data refers to a collection of points in three-dimensional space obtained by sensors such as lidar and depth cameras, and each point contains its coordinate information (x, y, z). Clustering refers to the process of dividing the points in the point cloud data into different categories or groups according to certain similarity metrics. The clustered obstacle point cloud data refers to the point cloud subset representing different obstacles obtained by clustering the original point cloud data. Noise points refer to abnormal points or outliers in point cloud data, which are usually caused by factors such as sensor measurement errors and environmental interference. The characteristic of noise points is that compared with the surrounding points, their coordinate values ​​or other attribute values ​​are significantly deviated from the normal range. In the calculation of obstacle contours, noise points need to be identified and filtered to avoid their influence on the contour calculation results. Downsampling refers to selecting a part of points from the original point cloud data as representatives to reduce the number of point clouds and the computational complexity. Uniform downsampling is a commonly used downsampling method, whose goal is to reduce the number of points as much as possible while maintaining the overall shape and distribution characteristics of the point cloud. Specific implementation methods include voxel downsampling, grid downsampling, etc., by dividing the point cloud into uniform voxels or grids, and selecting representative points in each voxel or grid as the downsampling result. AABB is the abbreviation of Axis-Aligned Bounding Box, which means a bounding box aligned with the coordinate axis. AABB bounding box is a simple and effective bounding volume representation method. By calculating the minimum and maximum values ​​of the point cloud data on each coordinate axis, a rectangular box that tightly surrounds the point cloud is obtained. The AABB bounding box contour refers to the rectangular contour representing the approximate shape and position of the obstacle obtained by calculating the AABB bounding box of the point cloud data. Ktree is a commonly used spatial index data structure for organizing and querying point data in multidimensional space. Ktree recursively divides the space into non-overlapping subspaces and stores the point data in the corresponding subspaces to form a tree-like hierarchical structure. In the calculation of obstacle contours, the ktree index can be used to speed up the search for the nearest neighbor point, that is, to search for the obstacle point cloud point closest to the given point in the ktree to extract the vertices of the circumscribed polygon.

[0010] Further, 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, obtains the number of points of the clustered obstacle point cloud, and compares 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, determines that the corresponding point cloud is a noise point, and does not perform subsequent contour calculation; when the number of points of the point cloud is greater than or equal to the noise threshold a, determines that the corresponding point cloud is a non-noise point; S22, for the point cloud determined as a non-noise point in step S21, compares the corresponding number of points 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 direction of the bounding box, rotate the original obstacle point cloud determined as non-noise 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 contour.

[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 the point cloud refers to the main trend or direction of the distribution of the 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 eigenvalue of the covariance matrix represents the variance of the point cloud in different directions, and the eigenvector represents the corresponding direction. 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 the case of 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, so as to improve the accuracy and efficiency of contour calculation.

[0014] Further, S22, a uniform downsampling algorithm is used to downsample the corresponding point cloud, including: determining a target resolution of 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 a plurality of cube grids of equal size, wherein the side length of each grid is 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, no representative point is generated in the downsampled point cloud; and the representative points of all grids are used 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 and retain more point cloud details; a larger target resolution will generate a sparser grid and the number of downsampled point clouds 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 a 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 a plurality of 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, which 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 realizes the downsampling processing of the point cloud by dividing the original point cloud into uniform cubic grids and selecting the representative points of each grid. The target resolution controls the size of the grid and the density of the downsampled point cloud, and the representative points of the grid are used to simplify the representation of the point cloud and reduce the amount of data of the point cloud. By reasonably setting the target resolution and calculating representative points according to the distribution of points in 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 according to 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 an octree algorithm to perform three-dimensional spatial 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 a preset threshold. The side length is less than or equal to the target resolution; traverse each cubic grid obtained by the octree algorithm, and adaptively determine the downsampling method of the grid according to the number of points and distribution characteristics of the original obstacle point cloud contained in the grid: if the number of points in the grid is greater than the preset threshold and the point distribution is relatively uniform, the coordinate average of all points in the grid is calculated, and the average value is used as the representative point of the grid; if the number of points in the grid is greater than the preset threshold but the point distribution is uneven, the points in the grid are clustered by local mean shift, and the center point of each cluster is used as the representative point of the grid; if the number of points in the grid is less than or equal to the preset threshold, all points in the grid are directly retained; all the representative points of the grid are used to form the obstacle point cloud after downsampling. According to the local point density and curvature change characteristics of the original point cloud, the target resolution of different sub-areas is adaptively determined, more points are retained in areas with rich point cloud details, and the point cloud density is reduced in areas with sparse and flat point clouds, which can reduce the amount of data and retain key features. At the same time, the improved scheme uses the octree algorithm to divide the point cloud into three-dimensional space, and obtains a grid that adapts to the local point cloud distribution through recursive division. In each grid, different downsampling methods are adaptively selected according to the number and distribution characteristics of the points, including direct averaging and local mean shift clustering, which can better preserve the overall distribution characteristics of the point cloud.

[0018] Further, S24, updating the AABB bounding box contour, including: calculating 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 according to 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 according to 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 contour according to 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 direction of the AABB bounding box and the main direction of the original obstacle point cloud as the rotation transformation angle. This angle represents the degree of deviation between the direction of the bounding box and the main direction of the point cloud. Then, a rotation transformation matrix is ​​constructed according to 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 around a certain axis or direction by a specified angle to obtain the obstacle point cloud after the rotation transformation. After the rotation transformation, the direction of the obstacle point cloud is aligned with the direction of the AABB bounding box, so that the bounding box can more closely surround the point cloud. According to the point cloud after the rotation transformation, 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, and finally the updated AABB bounding box outline is obtained. Through the rotation transformation, the direction alignment of the AABB bounding box and the obstacle point cloud can be achieved, and the compactness and representation accuracy of the bounding box can be improved. This is very important for the subsequent calculation and processing of the obstacle outline, and can more accurately describe the position, size and direction information of the obstacle.

[0021] Furthermore, S3 determines whether the preset polygonal contour calculation conditions are met based on the calculated length and width of the AABB bounding box contour 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 contour 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 corner point of the AABB bounding box to the obstacle point cloud is less than a preset distance threshold; when all three conditions are met at the same time, execute step S4, otherwise, use the AABB bounding box contour obtained in step S2 as the final contour of the obstacle.

[0022] Further, S4, when it is judged that the polygonal contour calculation condition is 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 judged to meet the polygonal contour calculation condition in step S3 is rotated to obtain a plurality of 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, search for the intersection point closest to the non-noise obstacle point cloud in step S2 through the index, extract all the nearest intersection points to form a nearest intersection set; S44, sort the nearest intersection set in a clockwise direction to obtain a sorted nearest intersection set, and connect the sorted nearest intersection set to form a closed obstacle circumscribed polygonal outline; S45, calculate the angle between the three adjacent vertices in the obstacle circumscribed polygonal outline, when the angle is greater than the preset simplified angle threshold, retain the two end vertices, remove the middle vertex, update the obstacle circumscribed polygonal outline, repeat the vertex removal process until the number of vertices of the obstacle circumscribed polygonal outline is less than the preset point number threshold b, and obtain the downsampled and simplified obstacle circumscribed polygonal outline as the final obstacle circumscribed polygonal outline.

[0023] Further, S43, using the ktree algorithm to establish an index of the sorted intersection set, traversing each intersection in the sorted intersection set, searching the intersection closest to the non-noise obstacle point cloud in step S2 through the index, extracting all the nearest intersections to form a nearest intersection set, including: using the octree algorithm to perform space division on the sorted intersection set obtained in step S42, 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, traversing the included intersections, for each intersection, using 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; calculating the corresponding The average distance from the intersection to the K nearest obstacle points is taken, and the intersection with the smallest average distance is taken as the nearest intersection of the corresponding sub-area; all sub-areas divided by the octree algorithm are traversed, the nearest intersection of each sub-area is extracted, and the nearest intersection set is constructed according to the original order of the nearest intersection in the sorted intersection set; the nearest intersection set is downsampled, and the distance between adjacent nearest intersections is calculated. When the distance is less than the preset merge distance threshold, the two nearest intersections are merged into one nearest intersection, and the nearest intersection set is updated; the merge operation is repeated until the distance between any two nearest intersections in the nearest intersection set is greater than the merge distance threshold; the obtained nearest intersection set is taken 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 set to form a closed obstacle circumscribed polygon outline.

[0024] Among them, octree is a tree-like data structure used to represent three-dimensional spatial data, and its full name is "octree". Octree recursively divides the three-dimensional space into eight equal-sized sub-regions (octants), and each sub-region corresponds to a node in the tree. In the process of building octree, if the number of data points contained in a sub-region exceeds the preset segmentation threshold, or the size of the sub-region is greater than the preset minimum size threshold, the sub-region will continue to be recursively divided until the stop condition is met. The leaf node of octree represents the smallest indivisible sub-region, and the non-leaf node represents the parent region containing the sub-region. Through spatial division and hierarchical organization, the octree algorithm can efficiently index and query the three-dimensional space, accelerating data retrieval and processing. K-Nearest Neighbors (KNN) is a commonly used supervised learning algorithm for solving classification and regression problems. In the K-Nearest Neighbors algorithm, for a given query point, the K sample points closest to it are searched in the training data set, and the query point is classified or predicted according to the category or attribute value of these K sample points.

[0025] In step S43, the octree algorithm is first used to perform spatial division on the sorted intersection set, and the three-dimensional space is recursively divided into eight sub-areas until the number of intersections contained in each sub-area is less than the segmentation threshold or the sub-area size is less than the minimum size threshold. Through the octree algorithm, the intersection set can be organized into a hierarchical tree structure, which is convenient for rapid retrieval and processing. Then, for each sub-area divided by the octree algorithm, the K nearest neighbor algorithm is used to search for the K obstacle points closest to each intersection in the non-noise obstacle point cloud, calculate the average distance from the intersection to the nearest obstacle point, and select the intersection with the smallest average distance as the nearest intersection of the sub-area. This step uses the K nearest neighbor algorithm to find the obstacle point closest to the intersection in the obstacle point cloud, which is used to determine the vertices of the circumscribed polygon outline. By traversing all sub-areas, the nearest intersection of each sub-area is extracted, and the nearest intersection set is constructed in the original order. Finally, the nearest intersection set is downsampled, and the intersections with closer 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 divide and index the intersection set to accelerate the retrieval of the nearest intersection; the K nearest neighbor algorithm is used to search for the obstacle point closest to the intersection 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, and the division dimension and division position are adaptively selected according to 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; using 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 search is performed downward until a leaf node is reached; then according to The Euclidean distance between the intersection and the obstacle point in the leaf node is used to select the K obstacle points with the closest distance. For each intersection, the average distance to the K nearest neighbor obstacle points found in step S432 is calculated, and the intersection with the smallest average distance is used as the nearest intersection of the corresponding intersection and retained in the nearest intersection set. The nearest intersection set is adaptively downsampled, and the downsampling algorithm and parameters are adaptively selected according to the local density and distribution characteristics of the nearest intersection. For areas with high local density and relatively uniform distribution, the voxel downsampling algorithm is used to divide the three-dimensional space where the nearest intersection is located into cubic grids of equal size, and the coordinate average value of the nearest intersection in each grid is calculated to generate a new nearest intersection. For areas with low local density or uneven distribution, the mean shift clustering algorithm is used to cluster the nearest intersections, and the centroid of each cluster is used as the new nearest intersection. The obtained set of downsampled nearest intersections is used as the vertex set of the obstacle circumscribed polygonal contour, and the vertices are connected in the order of the vertices in the nearest intersection set to form a closed obstacle circumscribed polygonal contour. An adaptive KD-tree algorithm is used to establish the spatial index of the sorted intersection set. The partitioning dimension and location are adaptively selected according to the local characteristics of the intersection distribution, which can better adapt to the uneven distribution of intersections and improve search efficiency. In the nearest neighbor search process, the tree structure of 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, and different downsampling algorithms and parameters are selected according to the local characteristics of the nearest intersection.For dense and evenly distributed areas, the voxel downsampling algorithm is used to quickly reduce the number of points; for sparse or unevenly distributed areas, the mean shift clustering algorithm is used to retain the distribution characteristics of key points. This adaptive downsampling processing method can maximize the geometric characteristics of the obstacle contour while reducing the amount of data. Finally, the nearest intersection set after downsampling is connected in sequence to generate a closed obstacle circumscribed polygonal contour, completing the obstacle contour extraction process.

[0027] Further, S5, the obtained circumscribed polygonal contour is subjected to angle calculation between adjacent points and point simplification to obtain a downsampled polygonal contour as the final contour of the obstacle, including: S51, projecting the circumscribed polygonal contours of the multiple obstacles obtained in step S4 onto the XOY plane, and calculating the intersection area of ​​any two circumscribed polygonal contours; comparing the intersection area with the contour area of ​​the smaller one of the two circumscribed polygonal contours, and when the ratio c of the intersection area to the contour area of ​​the smaller one is greater than a preset overlap threshold, eliminating the circumscribed polygonal contour with the smaller area; S52, for the circumscribed polygonal contours remaining after elimination in step S51, calculating 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, and r is less than a preset threshold R1, and c is greater than a preset minimum overlap ratio threshold, determining 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, reorder the vertices of the circumscribed polygonal contours with a smaller area and a 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 value R1, the overlap area ratio c is equal to 0, and the height overlap ratio d is greater than a preset threshold value, it is judged that the two circumscribed polygonal contours are adjacent; S55, for the 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, 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] Further, the merged circumscribed polygonal contour is obtained by re-arranging in a clockwise direction, including: calculating the coordinates of the geometric center point of the obstacle circumscribed polygonal contour as a reference point; traversing two adjacent vertices according to the original order of the vertex set of the obstacle circumscribed polygonal contour, 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; determining the relationship between the direction of the cross product result vector and the direction of the plane normal vector of the obstacle circumscribed polygonal contour; if the cross product result vector is consistent with the direction of the normal vector, determining 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, determining that the two adjacent vertices are collinear with the reference point; according to the determination result, adjusting the arrangement order of the vertex set of the obstacle circumscribed polygonal contour; if the connection direction of the adjacent vertices is counterclockwise, 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 prior art, the advantages of this application are:

[0031] By performing noise judgment and uniform downsampling on the obstacle point cloud, outliers and redundant points in the point cloud data are removed, the data size of the subsequent contour calculation is reduced, and the calculation efficiency is improved. At the same time, the downsampling process retains the geometric shape characteristics of the obstacle point cloud, laying the foundation for the subsequent accurate extraction of the obstacle contour.

[0032] The AABB bounding box contour is calculated based on the obstacle point cloud, and whether to further calculate the refined polygon contour is adaptively selected. For obstacles with small size and regular shape, the bounding box contour is directly used as an approximate representation of the obstacle, avoiding unnecessary computational overhead. For obstacles with large size and irregular shape, the polygon contour is further extracted to obtain a more accurate obstacle representation. This strategy can adaptively select the contour representation method according to the characteristics of the obstacle, balance the computational efficiency and representation accuracy, and thus improve the real-time performance and reliability of the system.

[0033] When calculating the polygonal contour, the spatial index algorithm is used to efficiently find the nearest intersection to the obstacle point cloud by rotating the AABB bounding box and calculating the intersection. This method avoids the high computational cost of brute force search for the nearest point and greatly improves the efficiency of contour extraction. At the same time, by extracting and sorting the nearest intersection set, a compact and regular obstacle circumscribed polygonal contour is obtained, which reduces the number of contour vertices and simplifies the complexity of the contour.

[0034] The vertex angles of the obtained circumscribed polygonal contours are calculated and simplified, and intersecting and adjacent polygonal contours are merged. By merging coplanar or adjacent polygonal contours, the number and complexity of obstacle contours are further reduced, making the final obstacle contour more concise and standardized. At the same time, the number of vertices of the simplified contour is greatly 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 by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

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

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

[0038] Figure 3 It 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 merging algorithm of polygon outlines 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 1It is an exemplary flow chart of a method for calculating the outline of an obstacle in an underground mine autonomous driving according to some embodiments of the present application, a method for calculating the outline of an obstacle in an underground mine autonomous driving, comprising: S1, obtaining clustered obstacle point cloud data; S2, judging whether it is a noise point according to the number of points of the obtained obstacle point cloud data, when the number of noise points is less than the noise threshold, not performing outline calculation; for non-noise obstacle point clouds, by counting the number of point clouds and uniformly downsampling the point clouds, calculating the AABB bounding box outline, and obtaining the length, width, center point and rotation angle of the bounding box matrix; S3, according to the calculation The obtained length and width of the AABB bounding box contour and the distance from the corner point of the bounding box to the obstacle point are used to determine whether the preset polygonal contour calculation conditions are met; 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 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; S5, the obtained circumscribed polygonal contour is calculated for the angle between adjacent points and the points are simplified to obtain the downsampled polygonal contour as the final contour of the obstacle.

[0043] Figure 2 This is an exemplary flow chart of a polygonal bounding box contour calculation algorithm according to some embodiments of the present application, which mainly includes the following steps: Before calculating the polygonal contour of an obstacle, it is necessary to determine whether it is necessary to perform polygonal contour calculation. Because the calculation of polygonal contours is relatively complex and time-consuming, if the shape and size of the obstacle meet certain conditions, its rectangular bounding box can be directly used as an approximate contour to improve calculation efficiency.

[0044] The conditions for determining whether polygon contour calculation is required are shown in 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 polygon contour calculation. Perform subsequent processing according to the judgment result. If the conditions are met, add the rectangular bounding box as the contour of the obstacle 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 perception and planning for autonomous driving 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 consider 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), then the equations of the lines on which their sides lie 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 of two straight lines, we can get: X = (k1*x1-y1-K1*X1+Y1) / (k1-K1); Y = k1*(X-x1)+y1; where k1 and K1 represent the slopes of the lines on which the edges of the rotated bounding box and the main bounding box are located, respectively. For each edge of the rotated bounding box, calculate the intersection with the four edges of the main bounding box, and a maximum of 8 intersections can be obtained. Determine whether the intersection is on the edge of the rotated bounding box and the main bounding box. 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. The angle of the intersection relative to the center of the rotated bounding box can be calculated based on the coordinates of the intersection, and then the intersections can be sorted in ascending order. Suppose the coordinates of the center of the rotated bounding box are (cx, cy) and the coordinates of the intersection are (X, Y), then 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 can calculate the angle based on the given y and x coordinates. Sort the intersections in ascending order according to the angle θ, and you will get a sequence of intersections arranged in a clockwise direction.

[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 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 specific steps of the search are as follows: Calculate the distance between the intersection and all the points in the k-tree index. Suppose the coordinates of the intersection are (x, y) and the coordinates of the point in the k-tree index are (xi, yi), then 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 the leaf node is searched. During the search, record the nearest point currently found and its distance. Use the nearest neighbor as the vertex of the circumscribed polygon. For each intersection, use the 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 intersections have found the corresponding nearest neighbor and obtain a complete set of vertices. Finally, sort the extracted vertices in a clockwise direction. The vertices can be sorted according to the angle relative to the center point of the obstacle point cloud. The sorting method is similar to that in step 2. Assume that the coordinates of the center point of the obstacle point cloud are (cx, cy) and the coordinates of the vertices are (xi, yi), then 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. By sorting the vertices in order from small to large according to the angle θi, a sequence of circumscribed polygon vertices arranged in a clockwise direction is obtained. By extracting the vertices of the circumscribed polygon and sorting the vertices in a clockwise direction, an accurate contour representation of the obstacle point cloud can be obtained. Compared with directly using the intersection of the rotating bounding box, the contour obtained by this method is more consistent with the actual shape of the obstacle and has higher accuracy. At the same time, due to the use of k-tree spatial indexing, 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, there may be some repeated or redundant vertices, resulting in a high complexity of the contour. In order 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 the clockwise direction. Calculate the angles α1 and α2 of the two vectors v1 and v2 formed by P1, P2, and P3. The specific calculation formula is 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 an inverse tangent function that can calculate 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 absolute value sign. The selection of the angle threshold δ needs to be set according to the specific application scenario and requirements. Usually, a smaller angle such as 5°, 10°, or 15° can be selected. If the absolute value of the difference in angles is less than the angle threshold δ, it is considered that vertex P2 can be omitted, and vertices P1 and P3 are directly used to form an edge of the contour. Specifically, vertex P2 is deleted from the vertex sequence, and then vertex P3 is used as the starting point for the next judgment, and the two vertices thereafter are considered. Repeat the above process, judge the difference in angles between three adjacent vertices in turn, and delete the intermediate vertices that can be omitted until one of the following two conditions is met: the number of simplified contour vertices is less than or equal to the preset vertex number threshold b. The selection of the vertex number threshold b needs to comprehensively consider the accuracy and complexity of the contour, and usually a smaller value such as 10, 20, or 30 can be selected. No intermediate vertex that can be omitted can be found, that is, the difference in angles between all three adjacent vertices is greater than or equal to the angle threshold δ. When one of the above conditions is met, the vertex simplification process is stopped to obtain the final simplified contour. By downsampling and simplifying the vertices of the circumscribed polygon, the complexity of the contour can be effectively reduced and the efficiency of contour representation can be improved. 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 polygonal 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 3It can be seen that the walls on both sides of the underground mine tunnel are long, with a length of more than 5 meters. The traditional rectangular bounding box algorithm has a poor representation effect on the outline of such slender obstacles, which will produce a large redundant space, causing the outline to be seriously protruding and occupying the drivable area of ​​the vehicle. However, the polygonal outline calculation algorithm of this application can fit the actual shape of the wall well and generate a compact and regular polygonal outline.

[0053] It can be seen from the polygonal outline of the wall in the figure that 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 drivable area of ​​the vehicle. This is due to the fact that the algorithm fully utilizes the spatial distribution characteristics of the obstacle point cloud when extracting the vertices of the circumscribed polygon. By calculating the intersection of the rotating bounding box and the main bounding box, and searching the nearest point of the 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 the present 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 according to the characteristics of the obstacle. For obstacles of smaller size, a simpler rectangular bounding box is directly used to represent it, avoiding 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 maximum extent, 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 4It is an exemplary flow chart of the merging algorithm of polygon outlines shown in some embodiments of the present application, which mainly includes the following steps: In order to filter overlapping polygon outlines, it is first necessary to project the extracted polygon outlines into the XOY plane. This step can be achieved by converting the three-dimensional coordinates (x, y, z) of the polygon outline into two-dimensional coordinates (x, y). Specifically, the z coordinates of the vertices of the polygon outline are ignored, and only the x and y coordinates are retained to obtain the projection of the polygon outline in the XOY plane. Next, the area of ​​intersection between any two groups of polygons is calculated. For N polygon outlines, C (N, 2) pairwise combinations are required to calculate the intersection area of ​​each pair of polygon outlines. The calculation of the intersection area can be achieved by computational geometry algorithms, and commonly used algorithms include scan line algorithms, polygon subdivision algorithms, etc. Here, taking the scan line algorithm as an example, for two polygons P1 and P2, first find their minimum and maximum coordinates in the Y-axis direction, and then start from the minimum coordinate, scan line by line, and calculate the intersection of P1 and P2 on each line. According to the parity of the intersection point, it can be determined which line segments on the current scan line 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, it is necessary to determine whether the ratio c of the intersection area to the area of ​​one of the polygon contours is greater than the preset overlap threshold. Assuming that 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 value of A1 and A2. If the ratio c is greater than the preset overlap threshold (for example, 0.8), it is considered that the two polygon contours have a high degree of overlap and need to be filtered. The principle of filtering is to retain more suitable contours and remove contours with a high degree of overlap. The suitability of contours can be evaluated based on the following aspects: Area size: Generally, polygon contours with larger areas contain more information and should be retained first. Position relationship: Considering the position relationship of polygon contours in three-dimensional space, if one contour is completely inside another contour, the inner contour should be removed. Contour shape: More regular and simple polygon contours are usually more suitable as approximate representations of obstacles and should be retained first. Considering the above factors comprehensively, choose to retain the most suitable polygon contours and filter out contours with a high degree of overlap.

[0057] For any two polygonal contours, it is necessary to determine whether they intersect, and if so, merge them. The conditions for determining intersection include three aspects: the vertical height overlap ratio d, the distance r between the polygon center points, and the overlap area ratio c. First, calculate the vertical height overlap ratio d of the two polygonal contours. Suppose the minimum and maximum z coordinates of the first polygonal contour are z1_min and z1_max, respectively, and the minimum and maximum z coordinates of the second polygonal contour are z2_min and z2_max, respectively. The 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 overlap height of the two polygonal contours in the vertical direction, max(z1_min, z2_min) represents the minimum overlap height, and the denominator represents the total height of the two polygonal contours in the vertical direction.

[0058] Next, calculate the distance r between the center points of the two polygonal contours. Assume that 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), then 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 area ratio c of the two polygonal contours, and the calculation method is the same as in step 1. If d is greater than the preset vertical overlap ratio threshold (for example, 0.8), r is less than the preset distance threshold (for example, 1 meter), and c is greater than the minimum overlap ratio threshold (for example, 0.2), then the two polygonal contours are considered to intersect and need to be merged. The specific method of merging is to first determine the area size of the two polygonal contours, determine the contour with a smaller area and the contour with a larger area. Then, count the vertices of the polygonal contour with a smaller area outside the polygonal contour with a larger area. This can be achieved by calculating the shortest distance from each vertex to the large contour. If the shortest distance is greater than a certain threshold (for example, 0.1 meter), then the vertex is considered to be outside the large contour. Merge the vertices of the smaller polygonal contour outside the larger contour with the vertices of the larger contour to obtain a new set of vertices. Rearrange this set of vertices according to certain rules, such as arranging them in counterclockwise order, to obtain a merged new contour. The calculation method of relevant parameters: 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); c = S / min (A1, A2); where S represents the intersection area of ​​the two polygonal contours, and A1 and A2 represent the areas of the two polygonal contours, respectively. By merging the intersecting polygonal contours, a more accurate and concise obstacle contour representation can be obtained. The merged contour can better reflect the actual shape and position of the obstacle, reducing the contour redundancy and discontinuity caused by over-segmentation. This is of great significance for improving the perception and decision-making capabilities of autonomous vehicles.

[0059] For any two polygonal contours, it is necessary to determine whether they are adjacent. If so, they are merged. The conditions for determining proximity include three aspects: the distance r between the center points of the polygons, the overlap area ratio, and the height overlap ratio d. First, calculate the distance r between the center points of the two polygonal contours. The calculation method is: 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 contours. Next, calculate the overlap area ratio of the two polygonal contours. Here, the overlap area ratio is required to be equal to 0, that is, the two polygonal contours do not intersect in the XOY plane. Finally, calculate the vertical overlap ratio d of the two polygonal contours. 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 the preset threshold R1 (for example, 1 meter), the overlap area ratio is equal to 0, and d is greater than the preset threshold (for example, 0.8), then the two polygonal contours are considered to be adjacent and need to be merged. The specific method of merging is to first determine the area size of the two polygonal contours and determine the contour with a smaller area and the contour with a larger area. Then, count the contour vertices with a smaller area and the contour vertices with a larger area to obtain a new set of vertices. This set of vertices is rearranged according to certain rules to obtain a new polygonal contour after merging.

[0060] Commonly used arrangement rules include: Arrange the vertices in counterclockwise order to ensure that the merged contour is still a valid polygon. Arrange the vertices from small to large according to the z coordinates of the vertices to ensure that the merged contour is continuous in the vertical direction. Arrange the distances from the vertices to the center of the polygon from small to large to ensure that the shape of the merged contour is relatively regular. You can choose the appropriate arrangement rule according to the specific application scenario and needs. By merging adjacent polygonal contours, the contour representation of the obstacle can be further simplified, and the number and complexity of contours can be reduced. This helps to improve the perception and planning efficiency of autonomous vehicles and reduce the consumption of computing resources. Simplify the merged polygonal contour. For the new polygonal contour obtained by merging, a downsampling simplification method similar to the previous one is used for processing. Along the arrangement order of the vertices, the angle change between two adjacent vertices is calculated in turn. If the angle change is less than the preset threshold, one of the vertices can be omitted to simplify the contour. Repeat this process until the number of vertices in the simplified contour is less than the 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 5It is a polygon wheel contour merging effect diagram shown in some embodiments of the present application, showing the effect of polygon contour merging, where red represents the obstacle vehicle in front, and green represents multiple polygon contours before merging. First, for each polygon contour to be merged, calculate its overlap ratio with the obstacle vehicle contour in front (red contour). Specifically, the polygon area intersection over union ratio (IoU, Inter section over Union) can be used to measure the overlap degree of two polygon contours. Let the green polygon contour be A and the red polygon contour be B, then their IoU can be expressed as: IoU (A, B) = Area (A∩B) / Area (A∪B); wherein 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 value range of IoU is [0, 1], and the larger the value, the higher the degree of overlap of the two polygon contours. When IoU is greater than the preset threshold C, it is considered that the green polygon contour has a high degree of overlap with the red polygon contour and needs to be merged. The selection of threshold C needs to be set according to the specific application scenario and requirements. Usually, a higher value such as 0.5, 0.6, or 0.7 can be selected. For each green polygon outline, calculate its IoU value with the red polygon outline to determine whether it is greater than threshold C. If the IoU is greater than threshold C, the green polygon outline is marked as a contour that needs to be merged.

[0062] Then, all green polygon outlines that need to be merged are filtered, and only the red polygon outline is retained as the final obstacle outline. Specifically, all green polygon outlines can be traversed and deleted from the outline set. After deletion, only the red polygon outline remains in the outline set, which is the merged obstacle outline. Through the polygon outline merging algorithm, repeated or similar obstacle outlines can be effectively filtered out to obtain a more accurate and concise obstacle representation. The merged outline can better reflect the true position 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 green polygonal contours A and B are calculated with the red polygonal contour C respectively. The IoU values ​​are: IoU (A, C) = 0.8; IoU (B, C) = 0.7; Assuming that the threshold C is set to 0.6, both the green polygonal contours A and B meet the merging conditions. A and B are deleted from the contour set, and only the red polygonal contour C is retained as the final obstacle contour. In this way, a simplified obstacle representation can be obtained through the polygonal contour merging algorithm, which improves the accuracy and efficiency of environmental perception and autonomous driving decision-making.

Claims

1. A method for calculating obstacle contours in underground mine automatic driving, comprising: S1, obtain the clustered obstacle point cloud data; S2, judging whether it is a noise point according to the number of points of the obtained obstacle point cloud data. When 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, and the length, width, center point and rotation angle of the bounding box matrix are obtained; S3, judging whether the preset polygon outline calculation conditions are met according to 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, and 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; S5, calculating the angles between adjacent points and simplifying the points of the obtained circumscribed polygonal contour, and obtaining a downsampled polygonal contour as the final contour of the obstacle.

2. The method for calculating obstacle contours in automatic driving of underground mines according to claim 1, characterized in that: S2, judging whether it is a noise point according to the number of points of the obtained obstacle point cloud data, and calculating the AABB bounding box contour for the obstacle point cloud that is not a noise point, 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 as non-noise points in step S21, the corresponding point number is compared with the preset downsampling threshold b; when the point number 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, by calculating the angle between any two points of the corresponding point cloud, obtaining the direction with the largest angle as the direction of the bounding box; S24, according to the direction of the bounding box, the original obstacle point cloud determined as non-noise in step S21 is rotated to make the direction of the obstacle point cloud 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 an updated AABB bounding box contour.

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 point number is compared with a preset downsampling threshold b; When the number of points in the point cloud is less than the downsampling threshold b, the covariance matrix of the corresponding point cloud is calculated; 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 automatic driving of underground mines according to claim 2, characterized in that: S22, using a uniform downsampling algorithm to downsample the corresponding point cloud, including: According to the density of the original obstacle point cloud, determine the target resolution of uniform downsampling; Perform 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; 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 cubic 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; 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 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 coordinates of the geometric center point of the obstacle point cloud after the rotation transformation as the coordinates of the center point of the updated AABB bounding box; Use the rotation transformation angle as the rotation angle of the updated AABB bounding box; Construct an updated AABB bounding box outline according to the length, width, center point coordinates and rotation angle of the updated AABB bounding box.

6. The method for calculating obstacle contours in underground mine automatic driving according to claim 1, characterized in that: S3, judging whether the preset polygon outline calculation conditions are met according to the calculated length and width of the AABB bounding box outline and the distance from the bounding box corner point to the obstacle point, including: Determine whether the length of the AABB bounding box contour 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; when all three conditions are met at the same time, execute step S4, otherwise, use the AABB bounding box contour obtained in step S2 as the final contour 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 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 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 contour that meets the polygon contour calculation condition 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 point set, traversing each intersection point in the sorted intersection point set, searching for the intersection point closest to the non-noise obstacle point cloud in step S2 through the index, and extracting all the closest intersection points to form a closest intersection point set; S44, sorting the nearest intersection point set in a clockwise direction to obtain a sorted nearest intersection point set, and connecting the sorted nearest intersection point set to form a closed obstacle circumscribed polygonal outline; S45, calculate the angle between three adjacent vertices in the obstacle circumscribed polygonal outline. When the angle is greater than a preset simplified angle threshold, retain the two end vertices, remove the middle vertex, 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, and obtain the obstacle circumscribed polygonal outline after downsampling simplification 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: For the sorted intersection point set obtained in step S42, the octree algorithm is used to perform space partitioning, and the three-dimensional space is recursively divided into eight sub-regions of equal size, until the number of intersection points 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, 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 take the intersection with the smallest average distance as the nearest intersection of the corresponding sub-region; Traverse all sub-regions divided 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; Downsampling the nearest intersection set, calculating the distance between adjacent nearest intersections, merging the two nearest intersections into one nearest intersection when the distance is less than a preset merge distance threshold, and updating the nearest intersection set; repeating 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 contour, 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 contour.

9. The method for calculating obstacle contours in automatic driving of underground mines according to claim 1, characterized in that: S5, calculating the angles between adjacent points and simplifying the points of 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 contour area of ​​the smaller area of ​​the two circumscribed polygonal contours, and when the ratio c of the intersection area to the contour area of ​​the smaller area 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, and r is less than a preset threshold R1, and c is greater than a preset minimum overlap ratio threshold, it is determined that the two corresponding circumscribed polygonal contours intersect; S53, for two circumscribed polygonal contours determined to be intersecting, counting the vertices of the circumscribed polygonal contour with a smaller area outside the circumscribed polygonal contour with a larger area, and reordering the vertices of the circumscribed polygonal contour with a smaller area and the circumscribed polygonal contour with a 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, it is determined that the two circumscribed polygonal contours are adjacent; S55, for 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 polygon outlines are merged, and the obtained circumscribed polygon outline is used as the final outline of the obstacle.

10. The method for calculating obstacle contours in automatic driving of underground mines according to claim 9, 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 a reference point; According to the original order of the vertex set of the obstacle circumscribed polygon outline, traverse two adjacent vertices and calculate 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 circumscribed polygonal contour; If the cross product vector is in the same direction as the normal vector, the connection direction of the two adjacent vertices is clockwise, otherwise it is counterclockwise; If the modulus of the cross product vector is equal to 0, then it is determined that the two adjacent vertices are collinear with the reference point; According to the judgment result, the arrangement order of the vertex set of the circumscribed polygon outline of the obstacle is adjusted; If the connection direction of adjacent vertices is counterclockwise, swap the positions of the two corresponding vertices in the vertex set; 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

  • Obstacle contour acquisition method, device and equipment and computer readable storage medium

    CN114255252A

  • Mechanical arm path planning method and system, computer equipment and storage medium

    CN115122322A

  • Method and system for determining barrier impassable area in unmanned scene

    CN115273016A

Cited By

  • Unmanned aerial vehicle route safety data analysis method and system for Web side

    CN120108235A

  • Point cloud data processing method and device, equipment and medium

    CN121330148A

  • A point cloud data processing method, device, equipment and medium

    CN121330148B