Object contour minimum bounding box generation method and device, storage medium and equipment
By filtering the maximum distance point and corner point of the point cloud cluster, fitting the heading angle with the random sampling consistency algorithm, and generating the minimum object profile enclosure box, the problem of insufficient calculation accuracy of point cloud data is solved and the path planning and obstacle avoidance capabilities of autonomous driving are improved.
Patent Information
- Application Number
- CN202510534796.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, in autonomous driving, the heading angle calculation of point cloud data is susceptible to interference and time-consuming to calculate, resulting in inaccurate generation of bounding boxes, affecting path planning and obstacle avoidance accuracy.
By filtering the maximum distance point and corner point of the target point cloud cluster, determining the preselected long sides, fitting the heading angle using a random sampling consistency algorithm, and generating the minimum object profile bounding box through the rotation matrix to ensure that the point cloud cluster is aligned with the coordinate system.
It improves the accuracy of heading angles and bounding boxes, provides more reliable environmental information support, and improves the accuracy and efficiency of intelligent driving perception.
Smart Images

Figure CN120388153A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and equipment for generating a minimum bounding box of an object outline. Background Art
[0002] In the field of autonomous driving, lidar and 4D millimeter-wave radar provide core support for environmental perception through point cloud data. The calculation of obstacle heading angles and the generation of minimum bounding boxes directly affect the vehicle's path planning and obstacle avoidance accuracy.
[0003] However, existing heading angle calculation methods, such as directly fitting a straight line to point cloud data, are susceptible to deviations due to interference from the point cloud's shape. Convex hull minimum area methods are not only computationally time-consuming but also prone to misjudging heading angles for unusual point clouds and exhibit poor environmental adaptability. When generating a bounding box, existing axis alignment methods cause volume expansion due to directional deviations, reducing the vehicle's traversable area and making them unsuitable for intelligent driving scenarios requiring high ranging accuracy.
[0004] Therefore, how to accurately detect the heading angle of the object point cloud and the minimum bounding box of the object contour becomes the key to improving the perception accuracy of intelligent driving. Summary of the invention
[0005] In view of the above problems, the present invention provides a method, apparatus, storage medium, and device for generating a minimum bounding box for an object outline that overcomes or at least partially solves the above problems. The technical solution is as follows:
[0006] A method for generating a minimum bounding box of an object outline, comprising:
[0007] Obtain the target point cloud cluster;
[0008] Filter out the maximum distance points and corner points of the target point cloud cluster;
[0009] Determining a preselected long side of the target point cloud cluster using the maximum distance point and the corner point;
[0010] Obtaining a long edge point cloud set of the preselected long edge, wherein the long edge point cloud set includes at least one long edge point cloud in the target point cloud cluster whose straight-line distance to the preselected long edge is within a preset distance threshold;
[0011] Performing straight line fitting on each of the long side point clouds in the long side point cloud set to obtain the heading angle of the target point cloud cluster;
[0012] The rotation matrix constructed according to the heading angle is used to perform translation and rotation transformation on the target point cloud cluster, and then the outline size and center point of the point cloud cluster are calculated to generate the minimum bounding box of the object outline of the target point cloud cluster.
[0013] Optionally, screening out the maximum distance points and corner points of the target point cloud cluster includes:
[0014] Filtering out the two points with the largest distance in the target point cloud cluster as maximum distance points, and connecting the two maximum distance points to construct a first straight line;
[0015] Traversing the second straight lines constructed by the remaining points in the target point cloud cluster except the maximum distance point and the origin of the coordinate system, calculating the intersection points of each second straight line with the first straight line, and calculating the distance difference between each intersection point and its corresponding remaining points;
[0016] The remaining points with the largest distance differences are selected as corner points.
[0017] Optionally, the determining a preselected long side of the target point cloud cluster by using the maximum distance point and the corner point includes:
[0018] The distances between the two maximum distance points and the corner point are calculated respectively, and a line connecting the maximum distance point and the corner point is selected as a preselected long side of the target point cloud cluster.
[0019] Optionally, performing straight line fitting on each of the long side point clouds in the long side point cloud set to obtain the heading angle of the target point cloud cluster includes:
[0020] Performing straight line fitting on each of the long edge point clouds in the long edge point cloud set using a random sampling consistency algorithm to construct a long edge straight line of the point cloud cluster;
[0021] The slope of the long side straight line of the point cloud cluster is converted into an angle to obtain the heading angle of the target point cloud cluster.
[0022] Optionally, the rotation matrix constructed according to the heading angle performs translation and rotation transformation on the target point cloud cluster, calculates the outline size and center point of the point cloud cluster, and generates the minimum bounding box of the object outline of the target point cloud cluster, including:
[0023] Calculating the centroid of the target point cloud cluster, and translating the target point cloud cluster to a coordinate system origin as the centroid;
[0024] Rotating the translated target point cloud cluster according to a rotation matrix constructed using the heading angle so that the preselected long side of the target point cloud cluster is aligned with the horizontal axis of the coordinate system;
[0025] Calculating the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis, and determining the point cloud cluster outline size and center point of the rotated target point cloud cluster;
[0026] Generate the minimum bounding box of the object contour of the target point cloud cluster according to the point cloud cluster contour size and the center point.
[0027] Optionally, the generating the minimum bounding box of the object contour of the target point cloud cluster according to the point cloud cluster contour size and the center point includes:
[0028] Perform coordinate conversion on the center point according to the rotation matrix and the translation vector of the target point cloud cluster to determine the center point coordinates of the target point cloud cluster before translation;
[0029] Based on the center point coordinates, generate the minimum bounding box of the object contour of the target point cloud cluster according to the point cloud cluster contour size.
[0030] Optionally, the rotation matrix is
[0031]
[0032] where represents the rotation matrix, is the heading angle.
[0033] A device for generating the minimum bounding box of an object contour includes: a point cloud cluster obtaining unit, a target point screening unit, a preselected long side determining unit, a long side point cloud set obtaining unit, a heading angle obtaining unit, and an object contour minimum bounding box generating unit.
[0034] The point cloud cluster obtaining unit is used to obtain a target point cloud cluster;
[0035] The target point screening unit is used to screen out the maximum distance point and the corner point of the target point cloud cluster;
[0036] The preselected long side determining unit is used to determine the preselected long side of the target point cloud cluster by using the maximum distance point and the corner point;
[0037] The long side point cloud set obtaining unit is used to obtain the long side point cloud set of the preselected long side, where the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance from the preselected long side is within a preset distance threshold;
[0038] The heading angle obtaining unit is used to perform linear fitting on each long side point cloud in the long side point cloud set to obtain the heading angle of the target point cloud cluster;
[0039] The object contour minimum bounding box generating unit is used to perform translation and rotation transformation on the target point cloud cluster according to the rotation matrix constructed based on the heading angle, calculate the point cloud cluster contour size and the center point, and generate the minimum bounding box of the object contour of the target point cloud cluster.
[0040] A computer-readable storage medium stores a program, which, when executed by a processor, implements the method for generating a minimum bounding box of an object outline.
[0041] An electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute the method for generating a minimum bounding box of an object outline.
[0042] By means of the above technical solution, the object contour minimum bounding box generation method, device, storage medium and equipment provided by the present invention obtain a target point cloud cluster; screen out the maximum distance point and corner point of the target point cloud cluster; use the maximum distance point and corner point to determine the preselected long side of the target point cloud cluster; obtain a long side point cloud set of the preselected long side, wherein the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance to the preselected long side is within a preset distance threshold; perform linear fitting on each long side point cloud in the long side point cloud set to obtain the heading angle of the target point cloud cluster; based on the rotation matrix constructed by the heading angle, perform translation and rotation transformation on the target point cloud cluster, calculate the point cloud cluster contour size and center point, and generate the object contour minimum bounding box of the target point cloud cluster. The present invention determines the preselected long side by screening the maximum distance points and corner points, improves the heading angle accuracy by combining threshold filtering of the point cloud and straight line fitting, and performs coordinate transformation on the point cloud based on the rotation matrix to generate a minimum bounding box that closely fits the object contour, thereby improving the heading detection and bounding box accuracy, and providing more reliable environmental information for intelligent driving perception.
[0043] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0045] Figure 1 A schematic diagram showing a flow chart of an implementation of a method for generating a minimum bounding box of an object outline provided by an embodiment of the present invention;
[0046] Figure 2Shows a schematic flowchart of another implementation manner of the method for generating the minimum bounding box of the object contour provided by the embodiment of the present invention;
[0047] Figure 3 Shows a schematic flowchart of another implementation manner of the method for generating the minimum bounding box of the object contour provided by the embodiment of the present invention;
[0048] Figure 4 Shows a schematic principle flowchart of the method for generating the minimum bounding box of the object contour provided by the embodiment of the present invention;
[0049] Figure 5 Shows a schematic illustration of the heading angle of the point cloud cluster provided by the embodiment of the present invention;
[0050] Figure 6 Shows a schematic illustration of the minimum bounding box of the object contour of the point cloud cluster provided by the embodiment of the present invention;
[0051] Figure 7 Shows a schematic structural diagram of the device for generating the minimum bounding box of the object contour provided by the embodiment of the present invention;
[0052] Figure 8 Shows a schematic structural diagram of the electronic device provided by the embodiment of the present invention. Specific embodiments
[0053] Hereinafter, the exemplary embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be more thoroughly understood and the scope of the present invention can be completely conveyed to those skilled in the art.
[0054] In the field of autonomous driving, environmental perception technology is the key to achieving safe driving. As the main sensors, lidar and 4D millimeter-wave radar can provide rich point cloud information to help the autonomous driving system accurately identify and locate surrounding obstacles. In the process of object detection, accurately calculating the heading angle of the object point cloud and generating the minimum bounding box of the contour is crucial, which can not only provide basic data for path planning but also effectively support the implementation of obstacle avoidance strategies.
[0055] At present, the commonly used methods for calculating the heading angle of point clouds mainly include two types: First, the line fitting method based on the RANSAC (Random Sample Consensus) algorithm. This method calculates the line slope by directly fitting a line to the point cloud cluster, and then converts it to the heading angle. However, the accuracy of this method is greatly affected by the shape characteristics of the point cloud cluster. In practical applications, the calculated heading angle may have a large deviation. Second, the convex hull minimum area method calculates the convex hull of the point cloud cluster of the obstacle, connects adjacent points in sequence to form the long side of the bounding box, projects other points onto this side to obtain the maximum short side, thereby calculating the area of the bounding box, and selects the long side corresponding to the minimum area as the heading angle of the point cloud cluster. This method can improve the calculation accuracy of the heading angle in some cases, but it takes a long time in the convex hull calculation process, and for the L-shaped point cloud cluster with approximately equal lengths of both sides, it may cause the heading angle to be consistent with the diagonal line, thus affecting the calculation result.
[0056] In the calculation of the bounding box of the point cloud contour, the common forms are divided into axis-aligned bounding boxes and oriented bounding boxes. The axis-aligned bounding box is the simplest form, usually taking the X-axis of the vehicle coordinate system as the heading angle of the point cloud cluster, and directly calculating the length, width, height dimensions and their center coordinates of the point cloud. However, in practical applications, when the actual direction of the object point cloud cluster is not parallel to the X-axis of the vehicle coordinate system, the generated bounding box may be inclined. At this time, the volume of the bounding box is often larger than the actual contour of the object, resulting in the enlargement of the contour size of the obstacle, thus reducing the area of the actual passable area of the road. Especially when the vehicle is turning, it may cause the object bounding box to occupy the entire road surface, making the autonomous driving vehicle unable to drive normally. Therefore, this method is not suitable for use in intelligent driving environments with high requirements for ranging accuracy.
[0057] Based on this, an embodiment of the present invention provides a method for generating a minimum bounding box for an object's outline. First, the two points with the largest distance between all points in a point cloud cluster are selected, and the equation of the first line corresponding to these two points' coordinates is calculated. Simultaneously, a second line equation is constructed between each point in the point cloud cluster and the origin. Next, the distance difference between the intersection of these two lines and the corresponding point is calculated, and the point with the largest distance difference is ultimately selected as the corner point of the point cloud cluster. Next, a distance threshold is set to select point clouds with long edges that meet the requirements, and a random sampling consistency algorithm is applied for line fitting. The resulting line slope can be converted into the heading angle of the point cloud cluster. Finally, the calculated heading angle is used to construct a rotation matrix, and the original point cloud is translated and rotated to a position with the origin of the coordinate system as its center of mass. The center coordinates of the point cloud cluster and its length, width, and height contour information are then calculated to determine the minimum bounding box for the object's outline. This embodiment of the present invention not only accurately represents the position information of an object's point cloud, but also precisely calculates the contour features of the object's point cloud, providing more reliable environmental data support for path planning in autonomous driving.
[0058] like Figure 1 FIG. 1 is a flow chart of an implementation of a method for generating a minimum bounding box of an object outline provided by an embodiment of the present invention. The method may include:
[0059] S100: Obtain a target point cloud cluster.
[0060] A target point cloud cluster refers to a collection of local point clouds with independent geometric features formed from discrete point cloud data collected by 3D sensors (such as lidar and 4D millimeter-wave radar) after being processed by a segmentation algorithm. A target point cloud cluster typically corresponds to a single object or part of an object in a real-world scene.
[0061] S110: Filter out the maximum distance points and corner points of the target point cloud cluster.
[0062] Among them, the maximum distance points refer to the two points with the largest distance between each other in the target point cloud cluster.
[0063] The embodiment of the present invention can calculate the Euclidean distance between each pair of points in the target point cloud cluster and find the pair of points with the largest distance as the maximum distance point, that is, compare all points in the target point cloud cluster pairwise to determine the farthest distance between them.
[0064] Corner points refer to points that represent edges or corners of objects in the target point cloud cluster. Embodiments of the present invention can calculate the corner points of the target point cloud cluster based on the two maximum distance points, or identify and extract the corner points of the target point cloud cluster using a specific corner detection algorithm.
[0065] S120: Determine the preselected long side of the target point cloud cluster using the maximum distance point and the corner point.
[0066] Among them, the preselected long side refers to the potential long side determined by analyzing the maximum distance point and the corner point in the target point cloud cluster, and is used to define the edge feature of the bounding box of the object corresponding to the target point cloud cluster.
[0067] S130. Obtain the long side point cloud set of the preselected long side, where the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance from the preselected long side is within the preset distance threshold.
[0068] Among them, the preset distance threshold is the maximum threshold for selecting the long side point cloud related to the preselected long side in the point cloud cluster. Only when the straight-line distance between the point in the point cloud cluster and the preselected long side is less than or equal to this threshold will it be considered a point related to the preselected long side. The specific value of the preset distance threshold may be related to the application scenario, point cloud density, and accuracy requirements.
[0069] Among them, the long side point cloud refers to the point in the point cloud cluster whose straight-line distance from the preselected long side does not exceed the preset distance threshold.
[0070] In the embodiment of the present invention, the straight-line distance between each point in the point cloud cluster and the preselected long side can be detected, and the points with the straight-line distance within the preset distance threshold are saved as long side point clouds into the long side point cloud set, so as to provide accurate basic data for the calculation of the heading angle in the subsequent process.
[0071] S140. Perform linear fitting on each long side point cloud in the long side point cloud set to obtain the heading angle of the target point cloud cluster.
[0072] Among them, linear fitting refers to the process of best matching the discrete points in the long side point cloud set with a straight line to find an optimal straight line such that the vertical distance between the straight line and the long side point clouds in the long side point cloud set is the smallest. The linear fitting algorithm can be the least squares method, the random sample consensus algorithm, the Hough transform algorithm, or the iterative closest point algorithm.
[0073] Among them, the heading angle refers to the orientation angle describing the object represented by the target point cloud cluster relative to the reference direction. The heading angle can be calculated from the slope of the straight line after linear fitting.
[0074] S150. According to the rotation matrix constructed based on the heading angle, perform translational and rotational transformation on the target point cloud cluster, and then calculate the contour size and the center point of the point cloud cluster to generate the minimum bounding box of the object contour of the target point cloud cluster.
[0075] Among them, the rotation matrix is used to perform rotational transformation on the object in the three-dimensional space.
[0076] The point cloud cluster outline dimensions describe the geometric features of the outer boundaries of the target point cloud cluster after translation and rotation transformations, including the object's length, width, and height. Embodiments of the present invention can calculate the object's dimensions in various directions by analyzing the minimum and maximum values of the point cloud cluster in each direction. For example, the length can be obtained by calculating the difference between the maximum and minimum values of the horizontal coordinate in the point cloud cluster.
[0077] The center point is used to describe the geometric center or center of gravity of the target point cloud cluster after translation and rotation transformation.
[0078] Among them, the minimum bounding box of the object contour refers to a minimum geometric shape that can completely enclose all points of the point cloud cluster.
[0079] The present invention provides a method for generating a minimum bounding box for an object's outline, comprising: obtaining a target point cloud cluster; screening out maximum distance points and corner points in the target point cloud cluster; determining a preselected long side of the target point cloud cluster using the maximum distance points and corner points; obtaining a long side point cloud set for the preselected long side, wherein the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance to the preselected long side is within a preset distance threshold; performing linear fitting on each long side point cloud in the long side point cloud set to obtain a heading angle of the target point cloud cluster; and performing a translation and rotation transformation on the target point cloud cluster based on a rotation matrix constructed from the heading angle to calculate the point cloud cluster's outline size and center point, thereby generating a minimum bounding box for the object's outline of the target point cloud cluster. The present invention determines the preselected long side by screening out the maximum distance points and corner points, improves heading angle accuracy by combining threshold filtering of the point cloud with linear fitting, and performs coordinate transformation on the point cloud based on the rotation matrix to generate a minimum bounding box that closely fits the object's outline, thereby improving heading detection and bounding box accuracy, thereby providing more reliable environmental information for intelligent driving perception.
[0080] Optional, based on Figure 1 The method shown, such as Figure 2 As shown, a flowchart of another implementation of a method for generating a minimum bounding box of an object outline provided by an embodiment of the present invention is shown, where step S110 may include:
[0081] S200 , selecting two points with the largest distance in the target point cloud cluster as maximum distance points, and connecting the two maximum distance points to construct a first straight line.
[0082] Specifically, the embodiment of the present invention can screen out two points with the largest distance between all points in the point cloud cluster (ie, the maximum distance points), and connect these two points to construct the first straight line of the target point cloud cluster.
[0083] For ease of understanding, the formula is explained here: Assume that the target point cloud cluster All points in , where the coordinates of each point are Project all points onto the XOY plane and get the coordinates of the points: .
[0084] First, calculate the Euclidean distance between each point using the formula :
[0085]
[0086] Then, find the maximum distance by the formula Two points and :
[0087]
[0088] Finally, connect the two maximum distance points to obtain the diagonal line (i.e. the first straight line). The equation of the first straight line can be expressed as:
[0089]
[0090] S210 , traversing the second straight lines constructed by the remaining points in the target point cloud cluster except the maximum distance point and the origin of the coordinate system, calculating the intersection points of each second straight line with the first straight line, and calculating the distance difference between each intersection point and its corresponding remaining points.
[0091] In the embodiment of the present invention, for each point in the point cloud cluster except the point with the maximum distance , which can be compared with the origin of the coordinate system Construct the second straight line. The equation of the second straight line can be expressed as:
[0092]
[0093] The embodiment of the present invention can solve the intersection point by solving the equations of the first straight line and the second straight line. The coordinates of the intersection point can be calculated using the following formula:
[0094]
[0095] Then calculate the intersection and corresponding points The distance difference between , the calculation formula is:
[0096]
[0097] S220. Select the remaining points with the largest distance differences as corner points.
[0098] The embodiment of the present invention can select points with a distance difference greater than zero, and these points will be regarded as point clouds close to the origin of the coordinate system. These points are stored in the container , use the following formula to filter:
[0099]
[0100] Among all the filtered points, keep the distance difference The largest point is regarded as the corner point of the entire point cloud cluster. The coordinates of the corner point are marked as , and its calculation formula is:
[0101]
[0102] The embodiment of the present invention screens the maximum distance points and corner points in the target point cloud cluster, first determines the two points with the largest distance as the maximum distance points, and connects them to form a first straight line as the baseline for subsequent geometric analysis. Then, by calculating the intersection of the second straight line constructed by the remaining points and the origin of the coordinate system with the first straight line, the distance difference between each intersection point and the corresponding point is calculated, and the point with the largest distance difference is selected as the corner point, thereby effectively capturing the boundary features of the target object and ensuring that the selected corner point can truly reflect the shape and properties of the object. Finally, the information of the maximum distance point and the corner point is combined to improve the characterization ability of the object shape, providing a reliable basis for subsequent long edge recognition, heading angle calculation and minimum bounding box generation, thereby enhancing the accuracy and efficiency of point cloud processing.
[0103] Optional, in the above Figure 1 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiment of the present invention, step S120 may include:
[0104] The distances between the two maximum distance points and the corner point are calculated respectively, and the line connecting the maximum distance point and the corner point with the largest distance is selected as the pre-selected long side of the target point cloud cluster.
[0105] In this embodiment of the present invention, the distances between the two points with the largest distances and the selected corner point are calculated. The point with the largest distance is then selected, and the line connecting it and the corner point is used as the preselected long side of the target point cloud cluster. Next, the equation of the line for the preselected long side is constructed using the two endpoints of the preselected long side:
[0106]
[0107] Then, the distance from the near side point (the point in the point cloud cluster close to the preselected long edge) to the line is calculated. :
[0108]
[0109] Finally, keep the distance Less than the preset distance threshold points, add them to the long edge point cloud collection is represented as: .
[0110] In the embodiments of the present invention, by calculating the distances between two maximum-distance points and the corner points respectively, and then selecting the line connecting the point with the maximum distance and the corner point as the preselected long side, the main extension direction of the object in space can be accurately captured, providing a reliable basis for the subsequent extraction of the long-side point cloud set and the calculation of the heading angle, thereby enhancing the accuracy and efficiency of generating the minimum bounding box of the object contour.
[0111] Optionally, based on the above Figure 1 one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present invention, step S140 may include:
[0112] Use the random sample consensus algorithm to perform line fitting on each long-side point cloud in the long-side point cloud set to construct the long-side line of the point cloud cluster. Convert the slope of the long-side line of the point cloud cluster into an angle to obtain the heading angle of the target point cloud cluster.
[0113] In the embodiments of the present invention, each long-side point cloud in the long-side point cloud set can be imported into the random sample consensus algorithm for line fitting, thereby constructing the long-side line of the point cloud cluster. The equation of the long-side line of the point cloud cluster is:
[0114]
[0115] Then, convert the slope of the long-side line of the point cloud cluster obtained by fitting into an angle , to obtain the heading angle of the target point cloud cluster. This conversion process is:
[0116]
[0117] In the embodiments of the present invention, using the random sample consensus algorithm for line fitting can effectively handle the outliers in the data, ensure that the constructed long-side line of the point cloud cluster is more accurate and robust, thereby finding the line equation that best conforms to the long-side point cloud set, and truly reflecting the geometric characteristics of the point cloud cluster. Next, convert the slope of the fitted line into an angle, making the calculation of the heading angle simple and intuitive. Through accurate calculation of the heading angle, it helps to further perform translation and rotation transformation of the point cloud cluster, calculate the size and center point of the object contour, thereby improving the accuracy and effectiveness of generating the minimum bounding box of the object contour.
[0118] Optionally, based on Figure 1 the method shown, as Figure 3 shown, a schematic flowchart of another implementation manner of the method for generating the minimum bounding box of the object contour provided by the embodiments of the present invention, step S150 may include:
[0119] S300: Calculate the centroid of the target point cloud cluster, and translate the target point cloud cluster so that the origin of the coordinate system is the centroid.
[0120] The embodiment of the present invention can firstly The centroid is calculated by averaging the coordinates of all points :
[0121]
[0122] in, is the number of points in the point cloud.
[0123] Next, the original target point cloud cluster is translated to the origin of the coordinate system so that its center of mass coincides with the origin. The translation process is:
[0124]
[0125] in, for The horizontal coordinate of the point before translation; for The horizontal coordinate of the point after translation; for The vertical coordinate of the point before translation; for The vertical coordinate of the point after translation.
[0126] S310 : Rotate the translated target point cloud cluster according to the rotation matrix constructed using the heading angle, so that the preselected long side of the target point cloud cluster is aligned with the horizontal axis of the coordinate system.
[0127] Specifically, the embodiment of the present invention can construct a rotation matrix R according to the heading angle, which is expressed as follows:
[0128]
[0129] in, represents the rotation matrix, is the heading angle.
[0130] This embodiment of the present invention uses a rotation matrix to rotate the target point cloud cluster that has been translated to the origin of the coordinate system so that the preselected long side of the target point cloud cluster is aligned with the horizontal axis (X-axis) of the coordinate system. Specifically, by performing a reverse rotation around the Z-axis, the preselected long side of the target point cloud cluster is aligned with the X-axis of the vehicle coordinate system:
[0131]
[0132] in, for The X-axis coordinate of the point before rotation; for The X-axis coordinate after the point is rotated; is The Y-axis coordinate before the point is rotated; is The Y-axis coordinate after the point is rotated; is The Z-axis coordinate before the point is rotated; is The Z-axis coordinate after the point is rotated.
[0133] S320. Calculate the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis, and determine the point cloud cluster contour size and center point of the rotated target point cloud cluster.
[0134] The embodiments of the present invention can screen out the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis:
[0135]
[0136] Among them, is the maximum value of the rotated target point cloud cluster on the X-axis; is the maximum value of the rotated target point cloud cluster on the Y-axis; is the maximum value of the rotated target point cloud cluster on the Z-axis; is the minimum value of the rotated target point cloud cluster on the X-axis; is the minimum value of the rotated target point cloud cluster on the Y-axis; is the minimum value of the rotated target point cloud cluster on the Z-axis.
[0137] By taking the difference between the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis, the point cloud cluster contour size of the rotated target point cloud cluster is obtained:
[0138]
[0139] Among them, is the length; is the width; is the height.
[0140] Next, calculate the average value of the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis to obtain the center point of the rotated target point cloud cluster , and the calculation formula is:
[0141]
[0142] S330. Generate the minimum bounding box of the object contour of the target point cloud cluster according to the point cloud cluster contour size and the center point.
[0143] In the embodiments of the present invention, the centroid of the target point cloud cluster can be calculated and translated to the origin of the coordinate system to ensure that all subsequent transformations are based on a unified reference point. Then, by applying the rotation matrix constructed according to the heading angle, the target point cloud cluster is rotated so that the preselected long side is aligned with the horizontal axis of the coordinate system, minimizing the deviation of the point cloud cluster in the directions of each coordinate axis and facilitating subsequent calculation of the contour dimensions. After rotation, by calculating the maximum and minimum values on each coordinate axis, the specific contour dimensions and the center point of the point cloud cluster are determined, and then the minimum bounding box of the object contour is generated to ensure that the bounding box can accurately enclose the target point cloud cluster.
[0144] Optionally, based on the above Figure 3 corresponding one or more embodiments, in another optional embodiment provided by the embodiments of the present invention, step S330 may include:
[0145] Perform coordinate conversion on the center point according to the rotation matrix and the translation vector of the target point cloud cluster to determine the center point coordinates of the target point cloud cluster before translation. Based on the center point coordinates, generate the minimum bounding box of the object contour of the target point cloud cluster according to the contour dimensions of the point cloud cluster.
[0146] Specifically, the embodiments of the present invention can reverse-rotate the coordinates of the center point through the training transfer matrix and, based on the translation vector of the target point cloud cluster, obtain the coordinates of the center point after it is translated to the original target point cloud cluster , and the conversion process is as follows:
[0147]
[0148] The embodiments of the present invention use the rotation matrix and the previously calculated translation vector to convert the center point coordinates back to the original coordinate system, ensuring that the bounding box is consistent with the actual position and orientation of the object, so as to accurately locate the spatial distribution of the target point cloud cluster, ensure the stability and effectiveness of the bounding box. The obtained minimum bounding box can not only effectively contain all points of the target point cloud cluster, but also provide a reliable data basis for subsequent object recognition, tracking, collision detection and other intelligent driving perceptions.
[0149] To facilitate understanding of the overall technical solution of the embodiments of the present invention, an illustration is provided here in conjunction with Figure 4 as follows: Figure 4The figure shows a flow chart of the principle of the method for generating the minimum bounding box of the object outline provided by an embodiment of the present invention. First, two points are selected from the point cloud cluster, and the distance between the two points is the largest, and the first straight line equation is calculated based on the coordinates of the two points. Next, by constructing the second straight line equation, each point in the point cloud cluster is connected to the origin, and the distance difference between the intersection of the two straight lines and each point is calculated, and the point with the largest distance difference is selected as the corner point. Then, the distance between the two maximum distance points and the corner point is calculated, and the point with a larger distance is selected as the pre-selected long side of the point cloud cluster. The long side point cloud is screened out by setting a distance threshold. The random sampling consistency algorithm is used to perform straight line fitting on the screened long side point cloud, and the slope of the straight line obtained is the heading angle of the point cloud cluster. The heading angle can be expressed as follows Figure 5 As shown. Use the heading angle to construct a rotation matrix. The original point cloud is translated to the origin of the coordinate system to align its center of mass. At the same time, the long side of the point cloud cluster is rotated to the same direction as the X-axis of the coordinate system. The center coordinates of the point cloud cluster and its length, width and height contour information are calculated. Based on the obtained contour information, the center coordinates are converted to the original point cloud cluster, and finally the minimum bounding box of the object contour is calculated to ensure that all point clouds of the point cloud cluster are included. Figure 5 The minimum bounding box of the object contour obtained by the heading angle shown can be Figure 6 The embodiment of the present invention provides reliable environmental data support for the path planning of the autonomous driving system by accurately describing the location information and contour features of the object point cloud.
[0150] Although the operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0151] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0152] Corresponding to the above method embodiment, the embodiment of the present invention provides a device for generating a minimum bounding box of an object outline, the structure of which is as follows: Figure 7 As shown, the apparatus may include: a point cloud cluster obtaining unit 10, a target point screening unit 20, a preselected long edge determining unit 30, a long edge point cloud set obtaining unit 40, a heading angle obtaining unit 50 and an object contour minimum bounding box generating unit 60.
[0153] The point cloud cluster obtaining unit 10 is used to obtain a target point cloud cluster.
[0154] The target point screening unit 20 is used to screen out the maximum distance points and corner points of the target point cloud cluster.
[0155] A preselected long side determination unit 30, configured to determine a preselected long side of a target point cloud cluster by using the maximum distance points and corner points.
[0156] A long side point cloud set obtaining unit 40, configured to obtain a long side point cloud set of the preselected long side, where the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance from the preselected long side is within a preset distance threshold.
[0157] A heading angle obtaining unit 50, configured to perform linear fitting on each long side point cloud in the long side point cloud set to obtain the heading angle of the target point cloud cluster.
[0158] An object contour minimum bounding box generating unit 60, configured to perform translation and rotation transformation on the target point cloud cluster according to a rotation matrix constructed based on the heading angle, calculate the contour size and center point of the point cloud cluster, and generate an object contour minimum bounding box of the target point cloud cluster.
[0159] Optionally, the target point screening unit 20 may specifically be configured to screen out two points with the largest distance in the target point cloud cluster as the maximum distance points, connect the two maximum distance points to construct a first straight line; traverse the second straight lines constructed by the remaining points in the target point cloud cluster except the maximum distance points and the origin of the coordinate system, calculate the intersection points of each second straight line and the first straight line, and calculate the distance difference between each intersection point and its corresponding remaining point; select the remaining point with the largest distance difference as the corner point.
[0160] Optionally, the preselected long side determination unit 30 may specifically be configured to calculate the distances between the two maximum distance points and the corner point respectively, and select the connection line between the maximum distance point with the largest distance and the corner point as the preselected long side of the target point cloud cluster.
[0161] Optionally, the heading angle obtaining unit 50 may specifically be configured to perform linear fitting on each long side point cloud in the long side point cloud set by using the random sample consensus algorithm to construct a long side straight line of the point cloud cluster; convert the slope of the long side straight line of the point cloud cluster into an angle to obtain the heading angle of the target point cloud cluster.
[0162] Optionally, the object contour minimum bounding box generating unit 60 may include: a point cloud cluster translation subunit, a point cloud cluster rotation subunit, a point cloud cluster data determination subunit, and a bounding box generating subunit.
[0163] The point cloud cluster translation subunit is configured to calculate the centroid of the target point cloud cluster and translate the target point cloud cluster to use the origin of the coordinate system as the centroid.
[0164] The point cloud cluster rotation subunit is configured to rotate the translated target point cloud cluster according to the rotation matrix constructed based on the heading angle so that the preselected long side of the target point cloud cluster is aligned with the horizontal axis of the coordinate system.
[0165] The point cloud cluster data determination subunit is used to calculate the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis, and determine the point cloud cluster outline size and center point of the rotated target point cloud cluster.
[0166] The bounding box generation subunit is used to generate the minimum bounding box of the object outline of the target point cloud cluster according to the outline size and center point of the point cloud cluster.
[0167] Optionally, the bounding box generation subunit can be specifically used to convert the coordinates of the center point according to the rotation matrix and the translation vector of the target point cloud cluster, and determine the coordinates of the center point of the target point cloud cluster before translation; based on the coordinates of the center point, the minimum bounding box of the object outline of the target point cloud cluster is generated according to the outline size of the point cloud cluster.
[0168] Optionally, the rotation matrix is:
[0169]
[0170] in, represents the rotation matrix, is the heading angle.
[0171] The present invention provides a device for generating a minimum bounding box for an object's outline. The device is used to obtain a target point cloud cluster; screen out the maximum distance points and corner points of the target point cloud cluster; determine a preselected long side of the target point cloud cluster using the maximum distance points and corner points; obtain a long side point cloud set for the preselected long side, wherein the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance to the preselected long side is within a preset distance threshold; perform linear fitting on each long side point cloud in the long side point cloud set to obtain a heading angle of the target point cloud cluster; and perform a translation and rotation transformation on the target point cloud cluster based on a rotation matrix constructed from the heading angle to calculate the point cloud cluster's outline size and center point, thereby generating a minimum bounding box for the object's outline of the target point cloud cluster. The present invention determines the preselected long side by screening the maximum distance points and corner points, improves the heading angle accuracy by combining threshold filtering of the point cloud with linear fitting, and performs coordinate transformation on the point cloud based on the rotation matrix to generate a minimum bounding box that closely fits the object's outline, thereby improving heading detection and bounding box accuracy, thereby providing more reliable environmental information for intelligent driving perception.
[0172] Regarding the apparatus in the above embodiment, the specific manner in which each unit performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0173] The device for generating the minimum bounding box of the object contour includes a processor and a memory. The above-mentioned point cloud cluster obtaining unit 10, target point screening unit 20, preselected long side determining unit 30, long side point cloud set obtaining unit 40, heading angle obtaining unit 50, and object contour minimum bounding box generating unit 60, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.
[0174] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set. By adjusting the kernel parameters, the preselected long side is determined by screening the maximum distance points and corner points. Combining the threshold to filter the point cloud and line fitting to improve the accuracy of the heading angle, and performing coordinate transformation on the point cloud based on the rotation matrix to generate the minimum bounding box that closely fits the object contour, thereby improving the heading detection and bounding box accuracy, and further providing more reliable environmental information for intelligent driving perception.
[0175] An embodiment of the present invention provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, it implements the method for generating the minimum bounding box of the object contour.
[0176] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein when the program runs, it executes the method for generating the minimum bounding box of the object contour.
[0177] As Figure 8 As shown, an embodiment of the present invention provides an electronic device 1000. The electronic device 1000 includes at least one processor 1001, at least one memory 1002 connected to the processor 1001, and a bus 1003; wherein, the processor 1001 and the memory 1002 complete mutual communication through the bus 1003; the processor 1001 is used to call the program instructions in the memory 1002 to execute the above-mentioned method for generating the minimum bounding box of the object contour. The electronic device herein can be a server, a PC, an ECU (Electronic Control Unit), a VCU (Vehicle Control Unit), an MCU (Micro Controller Unit), an HCU (Hybrid Control Unit), etc.
[0178] The present invention also provides a computer program product, which is suitable for executing a program initialized with the steps of the method for generating the minimum bounding box of the object contour when executed on an electronic device.
[0179] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable devices generate means for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or multiple blocks.
[0180] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, etc.
[0181] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory includes at least one storage chip. The memory is an example of computer-readable media.
[0182] Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
[0183] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions.
[0184] In the description of the present invention, it should be understood that if terms such as "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship, they are based on the orientation or positional relationship shown in the drawings. This is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the indicated position or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of the present invention.
[0185] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent in such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of another identical element in the process, method, commodity or device comprising the element.
[0186] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, etc.) containing computer-usable program code.
[0187] The above are only the embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the scope of the present invention.
Claims
1. A method for generating the minimum bounding box of an object contour, characterized in that include: Obtain the target point cloud cluster; Filter out the maximum distance points and corner points of the target point cloud cluster; Determining a preselected long side of the target point cloud cluster using the maximum distance point and the corner point; Obtaining a long edge point cloud set of the preselected long edge, wherein the long edge point cloud set includes at least one long edge point cloud in the target point cloud cluster whose straight-line distance to the preselected long edge is within a preset distance threshold; Performing straight line fitting on each of the long side point clouds in the long side point cloud set to obtain the heading angle of the target point cloud cluster; The rotation matrix constructed according to the heading angle is used to perform translation and rotation transformation on the target point cloud cluster, and then the outline size and center point of the point cloud cluster are calculated to generate the minimum bounding box of the object outline of the target point cloud cluster.
2. The method according to claim 1, wherein The step of screening out the maximum distance points and corner points of the target point cloud cluster includes: Filtering out the two points with the largest distance in the target point cloud cluster as maximum distance points, and connecting the two maximum distance points to construct a first straight line; Traversing the second straight lines constructed by the remaining points in the target point cloud cluster except the maximum distance point and the origin of the coordinate system, calculating the intersection points of each second straight line with the first straight line, and calculating the distance difference between each intersection point and its corresponding remaining points; The remaining points with the largest distance differences are selected as corner points.
3. The method according to claim 1, wherein The determining of the preselected long side of the target point cloud cluster by using the maximum distance point and the corner point includes: The distances between the two maximum distance points and the corner point are calculated respectively, and a line connecting the maximum distance point and the corner point is selected as a preselected long side of the target point cloud cluster.
4. The method according to claim 1, characterized in that The performing straight line fitting on each of the long side point clouds in the long side point cloud set to obtain the heading angle of the target point cloud cluster includes: Performing straight line fitting on each of the long edge point clouds in the long edge point cloud set using a random sampling consistency algorithm to construct a long edge straight line of the point cloud cluster; The slope of the long side straight line of the point cloud cluster is converted into an angle to obtain the heading angle of the target point cloud cluster.
5. The method according to claim 1, wherein The rotation matrix constructed according to the heading angle is used to perform translation and rotation transformation on the target point cloud cluster to calculate the outline size and center point of the point cloud cluster, and generate the minimum bounding box of the object outline of the target point cloud cluster, including: Calculating the centroid of the target point cloud cluster, and translating the target point cloud cluster to a coordinate system origin as the centroid; Rotating the translated target point cloud cluster according to a rotation matrix constructed using the heading angle so that the preselected long side of the target point cloud cluster is aligned with the horizontal axis of the coordinate system; Calculating the maximum and minimum values of the rotated target point cloud cluster on each coordinate axis, and determining the point cloud cluster outline size and center point of the rotated target point cloud cluster; The object outline minimum bounding box of the target point cloud cluster is generated according to the point cloud cluster outline size and the center point.
6. The method according to claim 5, characterized in that, Generating the minimum bounding box of the object outline of the target point cloud cluster according to the point cloud cluster outline size and the center point includes: performing coordinate conversion on the center point according to the rotation matrix and the translation vector of the target point cloud cluster to determine the coordinates of the center point of the target point cloud cluster before translation; Generate the minimum bounding box of the object contour of the target point cloud cluster according to the center point coordinates and the contour size of the point cloud cluster.
7. The method according to any one of claims 1 to 6, characterized in that The rotation matrix is Among them, represents the rotation matrix, is the heading angle.
8. An apparatus for generating a minimum bounding box of an object contour, characterized in that including: a point cloud cluster obtaining unit, a target point screening unit, a preselected long side determining unit, a long side point cloud set obtaining unit, a heading angle obtaining unit, and an object contour minimum bounding box generating unit; The point cloud cluster obtaining unit is configured to obtain a target point cloud cluster; The target point screening unit is configured to screen out the maximum distance point and the corner point of the target point cloud cluster; The preselected long side determining unit is configured to determine the preselected long side of the target point cloud cluster by using the maximum distance point and the corner point; The long side point cloud set obtaining unit is configured to obtain the long side point cloud set of the preselected long side, where the long side point cloud set includes at least one long side point cloud in the target point cloud cluster whose straight-line distance from the preselected long side is within a preset distance threshold; The heading angle obtaining unit is configured to perform linear fitting on each long side point cloud in the long side point cloud set to obtain the heading angle of the target point cloud cluster; The object contour minimum bounding box generating unit is configured to perform translation and rotation transformation on the target point cloud cluster according to the rotation matrix constructed based on the heading angle, calculate the contour size and the center point of the point cloud cluster, and generate the minimum bounding box of the object contour of the target point cloud cluster.
9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by a processor, it implements the object contour minimum bounding box generation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, The electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein, the processor and the memory complete communication with each other through the bus; the processor is configured to call program instructions in the memory to execute the object contour minimum bounding box generation method according to any one of claims 1 to 7.
Citation Information
Cited By
Carriage point cloud segmentation method based on geometric features and iterative optimization
CN122089762A