A method, device, electronic device and storage medium for segmenting a drivable area
By generating multiple plane parameters for point cloud classification based on the height difference and connectivity properties of radar point clouds in autonomous vehicles, the problem of low accuracy of segmentation of feasible areas under complex terrain is solved, and the driving safety of autonomous vehicles is improved sex.
Patent Information
- Application Number
- CN202411330701.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-23
AI Technical Summary
The prior art has low accuracy in segmentation of the feasible area of autonomous driving vehicles under complex terrain, making it difficult to accurately judge non-level ground and complex terrain.
By determining the connection attributes based on the point cloud height difference of the radar scanning area, selecting the base plane of the adjacent grid and the point cloud in the connecting domain as ground points, generating multiple plane parameters, and classifying point clouds to segment the travelable area.
It improves the accuracy of segmentation of feasible areas under complex terrain, can accurately judge multiple planes and divide them, and enhances the driving safety of autonomous driving vehicles.
Smart Images

Figure CN118840560B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving technology, and in particular to a method, device, electronic device and storage medium for segmenting a drivable area. Background Art
[0002] In order to ensure the safe driving of autonomous vehicles, it is necessary to accurately determine the drivable area on the road where the autonomous vehicles are driving. Currently, the drivable area is generally segmented based on the point cloud collected by the radar. Specifically, the scanning area of the radar can be divided into multiple grids. For each grid, the lowest point of the point cloud in the grid is determined as the ground seed point, and then the ground is fitted based on the determined ground seed point to fit the ground in the grid and obtain the candidate points of the fitted ground. Then, the ground is segmented based on the distance between the point cloud in the grid and the above candidate points to obtain the drivable area.
[0003] The above method can effectively segment the drivable area for simple terrain, but the terrain in the actual driving scenario of autonomous driving vehicles is complex and changeable, and the accuracy of segmenting the drivable area using the above method is low. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for segmenting a drivable area, so as to improve the accuracy of segmenting a drivable area. The specific technical solution is as follows:
[0005] In a first aspect of an embodiment of the present application, a method for segmenting a drivable area is provided, the method comprising:
[0006] Determine the connectivity attribute of the point cloud in the scanning area of the radar based on the height difference between the point clouds, wherein the connectivity attribute indicates whether the point cloud belongs to a connected domain along the scanning radial direction;
[0007] If it is detected based on the first point cloud in the first grid of the scanning area that the ground in the first grid is uneven, determining a first base plane where the ground with the lowest height in a second grid adjacent to the first grid is located;
[0008] Based on the distance between the point cloud and the first base plane, select a second point cloud belonging to the first base plane from the first point cloud, and select a third point cloud belonging to the connected domain from the first point cloud outside the second point cloud;
[0009] Generate plane parameters of the ground in the first grid using the second point cloud and the third point cloud as ground points;
[0010] The first grid is segmented into drivable areas based on the generated plane parameters.
[0011] In a possible implementation manner, the generating plane parameters of the ground in the first grid using the second point cloud and the third point cloud as ground points includes:
[0012] Generate plane parameters of the plane where the first flat ground in the first grid is located based on the second point cloud;
[0013] Determine a second base plane in the second grid where the ground that is higher than the first base plane is located;
[0014] If there is a fourth point cloud belonging to the second base plane in the third point cloud, and a fifth point cloud other than the fourth point cloud in the third point cloud satisfies a preset surface condition, plane parameters of a plane where the second flat ground in the first grid is located are generated based on the fourth point cloud, and plane parameters of a plane where the first slope in the first grid is located are generated based on the fifth point cloud;
[0015] Otherwise, plane parameters of a plane where the second slope in the first grid is located are generated based on the third point cloud.
[0016] In a possible implementation manner, segmenting the drivable area of the first grid based on the generated plane parameters includes:
[0017] Calculating the distance between each point cloud in the first grid and the plane described by the generated plane parameters;
[0018] Classifying the point cloud whose calculated distance is less than a distance threshold as a ground point in the first grid, and classifying the point cloud whose calculated distance is not less than the distance threshold as an obstacle point in the first grid, wherein the distance threshold is determined based on the flatness of the plane described by the generated plane parameters;
[0019] The drivable area is segmented from the first grid based on the point cloud classification result.
[0020] In a possible implementation manner, the distance threshold is determined according to the following expression:
[0021] ;
[0022] Wherein, threshold is the distance threshold, α is the first preset coefficient, th is the default distance threshold, and max(,) is the maximum value of the two numbers in the brackets. is the second preset coefficient, exp() is an exponential function with the natural constant e as the base, flag_value is the flatness, th flat is the flatness threshold.
[0023] In a possible implementation manner, whether the ground in the first grid is an uneven ground is detected in the following manner:
[0024] Performing plane fitting based on the first point cloud in the first grid to obtain plane parameters of the fitted plane;
[0025] Obtaining the flatness of the fitted plane according to the obtained plane parameters;
[0026] The obtained flatness is used to detect whether the ground in the first grid is uneven.
[0027] In a possible implementation manner, determining the connectivity attributes of the point clouds in the scanning area of the radar based on the height difference between the point clouds includes:
[0028] Selecting a sixth point cloud with the lowest height from the point cloud of the third grid in the scanning area;
[0029] Based on the sixth point cloud in the adjacent third grid, determining whether the height difference between the point clouds in the adjacent third grid is less than a preset height threshold, wherein the adjacent third grids are adjacent along the scanning radial direction;
[0030] If it is less than, the connectivity attribute of the point cloud in the adjacent third grid is determined to be an attribute that characterizes that the point cloud belongs to a connected domain along the scanning radial direction.
[0031] In a possible implementation manner, the first point cloud in the first grid is the sixth point cloud in the first grid.
[0032] In a possible implementation manner, the first grid is: sub-regions obtained by dividing a first number of concentric circle regions along a scanning radial direction, wherein the concentric circle regions are: regions with the same center obtained by dividing the scanning region according to point cloud density;
[0033] and / or
[0034] The third grid is: sub-areas obtained by dividing each radial area using a circular ring along the scanning tangent direction, wherein the radial area is: an area obtained by dividing the scanning area from the scanning center, along the scanning radial direction, and at the same azimuth angle.
[0035] In a second aspect of an embodiment of the present application, a drivable area segmentation device is provided, the device comprising:
[0036] A first determination module is used to determine the connectivity attribute of the point cloud in the scanning area of the radar based on the height difference between the point clouds, wherein the connectivity attribute represents whether the point cloud belongs to a connected domain along the scanning radial direction;
[0037] A second determination module is configured to determine a first base plane where the ground with the lowest height in a second grid adjacent to the first grid is located if it is detected based on the first point cloud in the first grid of the scanning area that the ground in the first grid is uneven;
[0038] A selection module, configured to select a second point cloud belonging to the first base plane from the first point cloud based on the distance between the point cloud and the first base plane, and select a third point cloud belonging to the connected domain from the first point cloud outside the second point cloud;
[0039] A generating module, configured to generate plane parameters of the ground in the first grid using the second point cloud and the third point cloud as ground points;
[0040] The segmentation module is used to segment the drivable area of the first grid based on the generated plane parameters.
[0041] In a possible implementation manner, the generating module is specifically used to:
[0042] Generate plane parameters of the plane where the first flat ground in the first grid is located based on the second point cloud;
[0043] Determine a second base plane in the second grid where the ground that is higher than the first base plane is located;
[0044] If there is a fourth point cloud belonging to the second base plane in the third point cloud, and a fifth point cloud other than the fourth point cloud in the third point cloud satisfies a preset surface condition, plane parameters of a plane where the second flat ground in the first grid is located are generated based on the fourth point cloud, and plane parameters of a plane where the first slope in the first grid is located are generated based on the fifth point cloud;
[0045] Otherwise, plane parameters of a plane where the second slope in the first grid is located are generated based on the third point cloud.
[0046] In a possible implementation manner, the segmentation module is specifically used to:
[0047] Calculating the distance between each point cloud in the first grid and the plane described by the generated plane parameters;
[0048] Classifying the point cloud whose calculated distance is less than a distance threshold as a ground point in the first grid, and classifying the point cloud whose calculated distance is not less than the distance threshold as an obstacle point in the first grid, wherein the distance threshold is determined based on the flatness of the plane described by the generated plane parameters;
[0049] The drivable area is segmented from the first grid based on the point cloud classification result.
[0050] In a possible implementation manner, the distance threshold is determined according to the following expression:
[0051] ;
[0052] Wherein, threshold is the distance threshold, α is the first preset coefficient, th is the default distance threshold, and max(,) is the maximum value of the two numbers in the brackets. is the second preset coefficient, exp() is an exponential function with the natural constant e as the base, flag_value is the flatness, th flat is the flatness threshold.
[0053] In a possible implementation manner, whether the ground in the first grid is an uneven ground is detected in the following manner:
[0054] Performing plane fitting based on the first point cloud in the first grid to obtain plane parameters of the fitted plane;
[0055] Obtaining the flatness of the fitted plane according to the obtained plane parameters;
[0056] The obtained flatness is used to detect whether the ground in the first grid is uneven.
[0057] In a possible implementation manner, the first determining module is specifically configured to:
[0058] Selecting a sixth point cloud with the lowest height from the point cloud of the third grid in the scanning area;
[0059] Based on the sixth point cloud in the adjacent third grid, determining whether the height difference between the point clouds in the adjacent third grid is less than a preset height threshold, wherein the adjacent third grids are adjacent along the scanning radial direction;
[0060] If it is less than, the connectivity attribute of the point cloud in the adjacent third grid is determined to be an attribute that characterizes that the point cloud belongs to a connected domain along the scanning radial direction.
[0061] In a possible implementation manner, the first point cloud in the first grid is the sixth point cloud in the first grid.
[0062] In a possible implementation manner, the first grid is:
[0063] Sub-areas obtained by dividing a first number of concentric circular areas along the scanning radial direction, wherein the concentric circular areas are: areas with the same center obtained by dividing the scanning area according to point cloud density; and / or
[0064] The third grid is: sub-areas obtained by dividing each radial area using a circular ring along the scanning tangent direction, wherein the radial area is: an area obtained by dividing the scanning area from the scanning center, along the scanning radial direction, and at the same azimuth angle.
[0065] In a third aspect of the embodiments of the present application, an electronic device is provided, including:
[0066] Memory, used to store computer programs;
[0067] The processor is used to implement the steps of any method described in the first aspect when executing the program stored in the memory.
[0068] In a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any method described in the first aspect are implemented.
[0069] In a fifth aspect of the embodiments of the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any of the methods described in the first aspect above.
[0070] Beneficial effects of the embodiments of the present application:
[0071] In the technical solution provided by the embodiment of the present application, when the electronic device detects that the ground in the first grid is not flat based on the first point cloud in the first grid of the scanning area of the radar, it means that the terrain in the first grid is not a simple plane, and the terrain is relatively complex. The electronic device segments the terrain in the first grid to determine the complex terrain in the first grid. The electronic device first selects the second point cloud belonging to the first basic plane and the third point cloud belonging to the connected domain but not the first basic plane from the first point cloud in the first grid based on the first basic plane where the ground with the lowest height in the adjacent second grid is located. The second point cloud and the third point cloud in the first grid are connected, but belong to different planes. The different planes to which the second point cloud and the third point cloud belong are combined into the ground. The electronic device uses the second point cloud and the third point cloud to perform plane fitting respectively, generate the plane parameters of each plane combined into the ground, and then judges whether all the point clouds in the first grid are ground points based on the plane parameters of these planes, so as to achieve the segmentation of the drivable area. In the above scheme, the electronic device can also accurately judge complex terrain, fit multiple planes that constitute the ground in the first grid and obtain the plane parameters of these planes, and segment the point cloud in the first grid into drivable areas based on the fitted multiple planes, thereby improving the accuracy of drivable area segmentation.
[0072] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0074] Figure 1 A schematic diagram of a first flow chart of a method for segmenting a drivable area provided in an embodiment of the present application;
[0075] Figure 2 A schematic diagram of a scanning radial direction of a radar provided in an embodiment of the present application;
[0076] Figure 3 A schematic diagram of a first division method of the scanning area of the radar provided in an embodiment of the present application;
[0077] Figure 4 A detailed flow chart of step S104 provided in an embodiment of the present application;
[0078] Figure 5 A topographic map of the first grid in the first example provided in an embodiment of the present application;
[0079] Figure 6 A topographic map of the first grid in the second example provided in an embodiment of the present application;
[0080] Figure 7 A detailed flow chart of step S105 provided in an embodiment of the present application;
[0081] Figure 8 A schematic diagram of planes with different flatnesses provided in an embodiment of the present application;
[0082] Fig. 9 A schematic diagram of a process for uneven ground detection provided in an embodiment of the present application;
[0083] Fig.10 A detailed flow chart of step S101 provided in an embodiment of the present application;
[0084] Fig.11 A schematic diagram of a second method of dividing the scanning area of the radar provided in an embodiment of the present application;
[0085] Fig.12 A second flow chart of the method for segmenting a drivable area provided in an embodiment of the present application;
[0086] Fig.13A schematic diagram of the structure of a drivable area segmentation device provided in an embodiment of the present application;
[0087] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0088] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0089] In order to ensure the safe driving of autonomous vehicles, it is necessary to accurately determine the drivable area on the road where the autonomous vehicles are driving. Currently, the drivable area is generally segmented based on the point cloud collected by the radar. Specifically, the scanning area of the radar can be divided into multiple grids. For each grid, the lowest point of the point cloud in the grid is determined as the ground seed point, and then the ground is fitted based on the determined ground seed point to fit the ground in the grid and obtain the candidate points of the fitted ground. Then, the ground is segmented based on the distance between the point cloud in the grid and the above candidate points to obtain the drivable area.
[0090] The above method can effectively segment the drivable area for simple terrain, but the terrain in the actual driving scenario of autonomous driving vehicles is complex and changeable, and the accuracy of segmenting the drivable area using the above method is low.
[0091] In order to solve the above problems, the present application embodiment provides a drivable area segmentation method, such as Figure 1 As shown, the method includes the following steps S101-S105.
[0092] The drivable area segmentation method provided in the embodiment of the present application can be applied to electronic devices such as desktop computers, laptop computers or servers. For ease of description, the execution subject of the drivable area segmentation method provided in the embodiment of the present application is collectively referred to as an electronic device.
[0093] S101, determining connectivity properties of point clouds in a scanning area of a radar based on height differences between point clouds.
[0094] Among them, the connectivity attribute represents whether the point cloud belongs to a connected domain along the scanning radial direction.
[0095] The above-mentioned radar can be a solid-state laser radar, a semi-solid-state laser radar or a multi-line mechanical laser radar. The radar can be installed directly above the vehicle to scan the surrounding environment to obtain corresponding point cloud data. The scanning area of the radar is a circular area with the radar as the center and the maximum detection distance of the radar as the radius. The scanning radial direction is the direction of the line connecting the center of the radar to any point in the scanning area.
[0096] The radar scans the surrounding environment to obtain a three-dimensional point cloud in a Cartesian coordinate system. The electronic device can obtain the above three-dimensional point cloud from the radar and convert the obtained three-dimensional point cloud from the Cartesian coordinate system to a polar coordinate system on a top-down plane. After the conversion, the electronic device obtains a two-dimensional point cloud, and each obtained two-dimensional point cloud has a height attribute.
[0097] Based on the height attribute of the two-dimensional point cloud, the electronic device can calculate the difference in the height attribute values of the point cloud at the same orientation from the radar outward along the radar's scanning radial direction. When the difference is less than a preset height threshold, the electronic device determines that the point clouds are connected. When the difference is greater than or equal to the preset height threshold, the electronic device determines that the two point clouds are not connected and no longer continues to judge the next point cloud outward. Then, the connected domain along the scanning radial direction can be determined based on the connected point clouds.
[0098] For example, Figure 2 As shown, point O is the location of the radar, and ray OP is a scanning radial direction of the radar. The electronic device can calculate the difference in height attribute values between the current point cloud and the next point cloud in sequence starting from point O along ray OP. If the difference in height attribute values between point cloud A and point cloud B calculated by the electronic device is less than the preset height threshold, it can be determined that point cloud A and point cloud B are connected; if the height difference between point cloud B and point cloud C calculated by the electronic device is greater than the preset height threshold, it can be determined that point cloud B and point cloud C are not connected, and the electronic device no longer compares the height difference between point cloud C and the next point cloud D, and determines that point cloud A and point cloud B belong to a connected domain along the scanning radial direction, and point cloud C and the subsequent point cloud D do not belong to a connected domain along the scanning radial direction.
[0099] After determining whether the point cloud belongs to a connected domain along the scanning radial direction, the electronic device may set a connectivity attribute for the point cloud belonging to the connected domain along the scanning radial direction, and distinguish it from the point cloud not belonging to the connected domain along the scanning radial direction. For example, the electronic device may set a connectivity attribute value of 1 for the point cloud belonging to the connected domain along the scanning radial direction, and set a connectivity attribute value of 0 for the point cloud not belonging to the connected domain along the scanning radial direction.
[0100] S102: If it is detected based on the first point cloud in the first grid of the scan area that the ground in the first grid is uneven, determine a first base plane where the ground with the lowest height in a second grid adjacent to the first grid is located.
[0101] The first grid is any sub-region obtained by dividing the radar scanning area. The first point cloud can be all point clouds scanned by the radar in the first grid, or a part of the point clouds selected from all point clouds in the first grid. The second grid is a plurality of sub-regions adjacent to the first grid in the divided radar scanning area. For example, the radar scanning area can be as follows: Figure 3 As shown in the division method, if grid A is taken as the first grid, then grid B, grid C, grid D and grid E are the four second grids adjacent to grid A.
[0102] In a possible implementation, the first grid may be divided as follows: a first number of concentric circle regions are divided into sub-regions along the scanning radial direction, wherein the concentric circle regions are regions with the same center obtained by dividing the scanning region according to the point cloud density.
[0103] For example, Figure 3 As shown in FIG. 1 , the scanning area of the radar is divided into four concentric circular areas with the same center, namely, the area within circle 1, the area between circle 1 and circle 2, the area between circle 2 and circle 3, and the area between circle 3 and circle 4. By dividing the four concentric circular areas respectively, multiple sub-areas can be obtained, each of which is a first grid, such as Figure 3 For each first grid, the region index m can be determined according to the concentric circle region to which the first grid belongs, where m∈[0,4). For example, starting from 0, grid A belongs to the third concentric circle region from the inside to the outside, and the region index m of grid A is 3.
[0104] For the mth concentric circle area, the number of tangential divisions is S m , the number of radial divisions is B m , dividing angle Δα m for:
[0105] ;
[0106] The tangent direction is the tangent direction of the concentric circles at any point in the radar scanning area, and the center of the concentric circles is the radar center.
[0107] The step size d of the partition radius m for:
[0108] ;
[0109] in, and are the maximum radius and minimum radius of the mth region respectively.
[0110] For each first grid, the tangent index s of the first grid can be determined according to the following expression:
[0111] ;
[0112] Among them, p i is any point cloud in the first grid, x i ,y i They are point clouds p i The two Cartesian coordinates of Indicates that the parameters are rounded down, atan2(y i ,x i ) represents the point cloud p i azimuth.
[0113] The radial index b of each first grid can be determined according to the grid number of the first grid in the radial region of the concentric circle region where the first grid is located. Figure 3 Grid A in is the second (counting from 0) area in a radial area of the third concentric circle area, so the radial index b of grid A is 2.
[0114] The set P of all point clouds in the first grid with region index m, radial index b, and tangential index s (m,s,b) It can be expressed as:
[0115] ;
[0116] Among them, p i represents any point cloud in the first grid, P represents all point clouds scanned by the radar, ρ i is the point cloud p i The distance to the radar.
[0117] The first grids divided in this way are more consistent with the actual radar scanning scene, and the information of each first grid can be more conveniently recorded by using the determined index of each first grid, which is convenient for subsequent judgment and calculation.
[0118] The electronic device may determine whether the ground in the first grid is a non-flat ground by detecting the degree of discreteness of the first point cloud. For example, the electronic device may determine the highest height and the lowest height of all point clouds in the first point cloud, and determine whether the difference between the highest height and the lowest height is greater than a preset flat height difference. If the difference between the highest height and the lowest height is greater than the preset flat height difference, the electronic device detects that the ground in the first grid is a non-flat ground; if the difference between the highest height and the lowest height is less than or equal to the preset flat height difference, the electronic device detects that the ground in the first grid is a flat ground.
[0119] The electronic device can generate plane parameters of the planes fitted in each second grid by performing plane fitting on the point cloud in the second grid. The plane fitting on the point cloud can be performed by multiple iterations of plane fitting methods such as singular value decomposition, least squares method, PCA (Principal Component Analysis), Patchwork++ (a fast and robust ground segmentation algorithm based on point cloud), etc., to obtain the final plane parameters. The plane parameters of the plane fitted in the second grid include the plane equation, that is, the normal vector and intercept of the plane, as well as the coordinates of the center point of the plane, singular vectors, etc. When performing plane fitting, the matrix composed of the selected multiple point clouds is subjected to singular value decomposition, and the singular vector corresponding to the minimum singular value obtained represents the direction with the smallest range of point cloud changes, which can be used as the normal vector of the fitted plane, and the minimum singular value corresponding to the singular vector can be used as the flatness of the fitted plane.
[0120] Based on the flatness of the planes fitted in each second grid, the electronic device can first determine a high-confidence plane whose flatness is greater than a set flatness threshold in the planes fitted in each second grid, and these high-confidence planes can be regarded as the ground of the second grid; then, according to the coordinates of the center points of each plane, select the ground with the lowest height from these high-confidence planes, and determine the first base plane where the ground with the lowest height is located. The plane equation of the first base plane is the same as the plane equation of the determined ground with the lowest height.
[0121] S103, based on the distance between the point cloud and the first base plane, selecting a second point cloud belonging to the first base plane from the first point cloud, and selecting a third point cloud belonging to the connected domain from the first point cloud outside the second point cloud.
[0122] The electronic device calculates the distance from each first point cloud to the first base plane according to the height attribute of each point cloud, the normal vector and the intercept of the first base plane, etc., determines that the first point cloud whose distance to the first base plane is less than a preset threshold is the second point cloud belonging to the first base plane, and records it. Subsequently, the ground in the first grid can be determined according to the second point cloud.
[0123] After determining the second point cloud belonging to the first base plane, for other point clouds in the first point cloud that do not belong to the first base plane, the electronic device can determine whether these point clouds belong to a connected domain along the scanning radial direction based on the connectivity properties of these point clouds, and take the point clouds belonging to the connected domain along the scanning radial direction as the third point cloud and record them. Subsequently, the ground in the first grid can be determined based on the third point cloud.
[0124] For the point clouds in the first point cloud that belong neither to the second point cloud nor to the third point cloud, since these point clouds do not belong to the connected domain, it means that these point clouds may be curbs or obstacle points, and the electronic device will not determine the ground in the first grid based on these point clouds.
[0125] S104: Generate plane parameters of the ground in the first grid using the second point cloud and the third point cloud as ground points.
[0126] The plane parameters include the plane equation, the coordinates of the plane center point, the singular vectors, etc. The electronic device can perform plane fitting based on the second point cloud and the third point cloud, respectively, and obtain the plane parameters of the ground generated by plane fitting according to the second point cloud, and the plane parameters of the ground generated by plane fitting according to the third point cloud, respectively. Here, the plane fitting of the point cloud can also be performed by multiple iterations using singular value decomposition, least squares method, PCA, Patchwork++ and other methods to obtain the final plane parameters. The generated plane parameters of the ground include the plane equation of the ground, the coordinates of the plane center point of the ground, and the singular vectors, etc. The ground in the first grid can be composed of these two fitted planes.
[0127] S105: Segment the drivable area of the first grid based on the generated plane parameters.
[0128] The drivable area is an area that does not include non-ground points. Non-ground points include curbs and obstacle points. The plane parameters generated above determine the ground in the first grid. The electronic device can calculate whether the distance from each point cloud in the first grid to the ground is less than the distance threshold based on the height attribute of each point cloud in the first grid, and the normal vector and intercept in the generated plane parameters. Thus, the electronic device can determine that the point cloud whose distance to the ground is less than the distance threshold is a ground point, and the point cloud whose distance to the ground is greater than or equal to the distance threshold is a non-ground point. The electronic device represents all the determined non-ground points with an occupied grid, that is, the grid with non-ground points is marked as occupied, and the grid without non-ground points will not be marked, so that the electronic device can divide the grid that is not marked as occupied into a drivable area.
[0129] In the technical solution provided by the embodiment of the present application, when the electronic device detects that the ground in the first grid is not flat based on the first point cloud in the first grid of the scanning area of the radar, it means that the terrain in the first grid is not a simple plane, and the terrain is relatively complex. The electronic device segments the terrain in the first grid to determine the complex terrain in the first grid. The electronic device first selects the second point cloud belonging to the first basic plane and the third point cloud belonging to the connected domain but not the first basic plane from the first point cloud in the first grid based on the first basic plane where the ground with the lowest height in the adjacent second grid is located. The second point cloud and the third point cloud in the first grid are connected, but belong to different planes. The different planes to which the second point cloud and the third point cloud belong are combined into the ground. The electronic device uses the second point cloud and the third point cloud to perform plane fitting respectively, generate the plane parameters of each plane combined into the ground, and then judges whether all the point clouds in the first grid are ground points based on the plane parameters of these planes, so as to achieve the segmentation of the drivable area. In the above scheme, the electronic device can also accurately judge complex terrain, fit multiple planes that constitute the ground in the first grid and obtain the plane parameters of these planes, and segment the point cloud in the first grid into drivable areas based on the fitted multiple planes, thereby improving the accuracy of drivable area segmentation.
[0130] For the step of using the second point cloud and the third point cloud as ground points to generate the plane parameters of the ground in the first grid in the above step S104, the embodiment of the present application also provides an implementation method, such as Figure 4 A detailed flow chart of step S104 is shown, and the implementation method may include the following steps S401-S404.
[0131] Step S401: Generate plane parameters of a plane where a first flat ground in a first grid is located based on a second point cloud.
[0132] The first flat ground is the ground component with the lowest height in the first grid. The electronic device can directly use the plane equation of the first base plane as the plane equation of the plane where the first flat ground is located. For other plane parameters of the plane where the first base plane is located, the electronic device can determine based on the second point cloud. The electronic device can determine the average coordinates based on the coordinates of all second point clouds as the plane center point coordinates of the plane where the first flat ground is located, solve the singular vectors and singular values based on the coordinates of the second point cloud and the plane equation of the plane where the first base plane is located, and use the minimum singular value obtained as the flatness of the plane where the first flat ground is located.
[0133] For example, Figure 5 A topographic map of the first grid is shown. Figure 5The lowest ground component in the first grid shown is plane 1, that is, plane 1 is the plane where the first flat ground is located. After the electronic device determines the second point cloud belonging to the first base plane according to the above step S103, it can use the plane equation of the first base plane as the plane equation of plane 1 where the second point cloud is located, and determine the coordinates of the plane center point of plane 1 based on the average coordinates of the second point cloud, solve the singular vectors and singular values based on the coordinates of the second point cloud and the plane equation of plane 1, and use the minimum singular value obtained as the flatness of plane 1.
[0134] In order to improve the accuracy of the plane parameters of the plane where the first flat ground is located, the electronic device can also re-perform plane fitting based on the second point cloud to generate the plane parameters of the plane where the first flat ground is located. Specifically, the electronic device can use a common plane fitting method to perform plane fitting to obtain plane parameters such as plane equations, plane center point coordinates, and singular vectors. Common plane fitting methods can refer to the plane fitting methods listed in the relevant description of step S102, which will not be repeated here.
[0135] Step S402: determine a second base plane in the second grid where the ground that is higher than the first base plane is located.
[0136] Here, reference may be made to the implementation method of the electronic device determining the first base plane in the related description of the above step S102. The electronic device may first determine a high-confidence plane whose flatness is greater than a set flatness threshold according to the flatness of the plane obtained by fitting in the second grid, and then select a ground plane higher than the first base plane from these high-confidence planes according to the coordinates of the plane center points of each plane, and determine a second base plane where the selected ground plane is located. The plane equation of the second base plane is the same as the plane equation of the selected ground plane.
[0137] Step S403, if there is a fourth point cloud belonging to the second base plane in the third point cloud, and the fifth point cloud in the third point cloud except the fourth point cloud meets the preset surface conditions, then the plane parameters of the plane where the second flat ground in the first grid is located are generated based on the fourth point cloud, and the plane parameters of the plane where the first slope in the first grid is located are generated based on the fifth point cloud.
[0138] The preset surface forming condition may be that there are non-collinear point clouds in the fifth point cloud, so that the electronic device can fit a plane based on the fifth point cloud.
[0139] The electronic device can select a fourth point cloud belonging to the second base plane from the third point cloud based on the distance from the point cloud to the second base plane. For details on how to select the fourth point cloud, please refer to the relevant description of step S103, and the implementation method of the electronic device selecting the second point cloud belonging to the first base plane will not be repeated here. After determining that the fourth point cloud belongs to the second base plane, for the fifth point cloud in the third point cloud that does not belong to the second base plane, the electronic device can determine whether the fifth point cloud meets the preset surface condition.
[0140] When the fifth point cloud meets the preset surface conditions, it means that the ground in the first grid is composed of three planes: the first flat ground, the plane where the fourth point cloud is located, and the plane where the fifth point cloud is located. Among them, the first flat ground and the plane where the fourth point cloud is located are connected to the ground in the adjacent second grid, and the plane where the fifth point cloud is located is not connected to the ground in the adjacent second grid, which means that the plane where the fifth point cloud is located is located between the first flat ground and the plane where the fourth point cloud is located, that is, the plane where the fifth point cloud is located is a slope. The electronic device can generate the plane parameters of the plane where the second flat ground is located based on the fourth point cloud, and generate the plane parameters of the plane where the first slope is located in the first grid based on the fifth point cloud.
[0141] For example, Figure 5 As shown, Figure 5 The ground in the first grid shown includes, in addition to the lowest plane 1, plane 2 and slope 1, wherein plane 2 is connected to the ground in the adjacent second grid. The second base plane determined by the electronic device in executing step S402 may be the plane where the ground in the second grid adjacent to plane 2 is located. For the second grid adjacent to the right side of the first grid, since it is connected to plane 1, plane 2 and slope 1 at the same time, the flatness of the ground in the second grid is low, and the electronic device will not determine it as a high-confidence plane, and will not determine it as the second base plane. For the second grid adjacent to the left side of the first grid, the electronic device will not determine it as the second base plane for the same reason as above.
[0142] After determining the second base plane, the electronic device can determine that there is a fourth point cloud belonging to the second base plane in the third point cloud, that is, a point cloud on plane 2; for the fifth point cloud other than the fourth point cloud in the third point cloud, that is, the fifth point cloud on slope 1, the electronic device can determine that these point clouds meet the surface condition. Thus, it can be determined that Figure 5 The ground in the first grid shown is composed of three planes: the first base plane, the plane where the fourth point cloud is located, and the plane where the fifth point cloud is located. Figure 5As shown, the first base plane, that is, plane 1, is connected to the ground in the second grid adjacent to the bottom of the first grid; the plane where the fourth point cloud is located, that is, plane 2, is connected to the ground in the second grid adjacent to the top of the first grid; and the plane in the second grid adjacent to the right side of the first grid has poor flatness and does not constitute the ground, so the plane where the fifth point cloud is located, that is, slope 1, is not connected to the ground in the adjacent second grid; therefore, it can be determined that the plane where the fifth point cloud is located is a slope between the first base plane and the plane where the fourth point cloud is located.
[0143] For the plane equation of the second flat ground, the electronic device can directly use the plane equation of the second base plane as the plane equation of the second flat ground; for other plane parameters of the second flat ground, the electronic device can determine them based on the fourth point cloud. For example, the electronic device can determine the average coordinates based on the coordinates of all fourth point clouds as the coordinates of the plane center point of the plane where the second flat ground is located, and solve the singular vectors based on the coordinates of the fourth point cloud and the plane equation to obtain the flatness of the plane where the first flat ground is located. In order to improve the accuracy of the acquired plane parameters of the plane where the second flat ground is located, the electronic device can also re-perform plane fitting based on the fourth point cloud to generate the plane parameters of the plane where the second flat ground is located. Specifically, the electronic device can use common plane fitting methods to perform plane fitting to obtain plane parameters such as plane equations, plane center coordinates, singular vectors, etc. Common plane fitting methods can refer to the plane fitting methods listed in the relevant description of step S102, which will not be repeated here.
[0144] For the first slope, the electronic device can perform plane fitting based on the fifth point cloud to generate plane parameters of the plane where the first slope is located. Specifically, the electronic device can use a common plane fitting method to perform plane fitting to obtain plane parameters such as plane equations, plane center coordinates, and singular vectors. Common plane fitting methods can refer to the plane fitting methods listed in the relevant description of step S102, which will not be repeated here.
[0145] Step S404: otherwise, generate plane parameters of the plane where the second slope in the first grid is located based on the third point cloud.
[0146] The second slope and the first flat ground constitute the ground in the first grid. If there is no point cloud belonging to the second base plane in the third point cloud, the ground in the first grid is constituted by the first flat ground and the slope where the third point cloud is located.
[0147] If the fifth point cloud does not meet the preset surface condition, it means that the fifth point cloud may be an obstacle point or a point cloud with calculation errors, and does not form a plane. At this time, the ground in the first grid is composed of the first flat ground and the slope where the third point cloud is located.
[0148] For example, Figure 6As shown, Figure 6 The ground in the first grid shown in is composed of a plane 3 and a slope 2. The electronic device can determine the second point cloud belonging to the first base plane when executing step S103, and generate the plane parameters of the plane 3 based on the determined second point cloud when executing step S401 in the refinement process of step S104. When executing step S402, the electronic device determines that the ground in the second grid adjacent to the first grid is the second base plane. When executing step S403, the electronic device can determine that there is a fourth point cloud belonging to the second base plane in the third point cloud, and the electronic device determines that there are no other point clouds in the third point cloud except the fourth point cloud on the second base plane, or there are only individual missing point clouds, so that the fifth point cloud in the third point cloud except the fourth point cloud will not meet the preset surface condition. That is, the ground in the first grid is composed of the plane 3 generated by the second point cloud belonging to the first base plane and the slope 2 where the third point cloud is located.
[0149] The electronic device can perform plane fitting based on the third point cloud to generate plane parameters of the plane where the second slope is located. Specifically, the electronic device can use a common plane fitting method to perform plane fitting to obtain plane parameters such as plane equations, plane center coordinates, and singular vectors. Common plane fitting methods can refer to the plane fitting methods listed in the relevant description of step S102, which will not be repeated here.
[0150] In the technical solution provided in the embodiment of the present application, a second basic plane is further determined, and accurate judgment can be made on complex terrain where the ground is composed of more than three planes, and plane parameters of each plane that constitutes the ground are generated, thereby further improving the accuracy of subsequent point cloud classification based on the generated plane parameters, thereby further improving the accuracy of drivable area segmentation.
[0151] Regarding the step of segmenting the drivable area in step S105, the present application embodiment also provides an implementation method, such as Figure 7 A detailed flow chart of step S105 is shown, and the implementation method may include the following steps S701-S703.
[0152] Step S701, calculating the distance between each point cloud in the first grid and the plane described by the generated plane parameters.
[0153] When there are multiple planes described by the generated plane parameters, for each point cloud in the first grid, the electronic device can calculate the distance between the point cloud and each plane according to the coordinates of the point cloud and the normal vector and intercept of each plane, using the point-to-plane distance formula. The electronic device can also calculate the distance between the point cloud and each plane according to the coordinates of the point cloud and the normal vector, intercept and plane center point coordinates in the plane parameters of each plane.
[0154] Step S702: classify the point cloud whose calculated distance is less than the distance threshold as ground points in the first grid, and classify the point cloud whose calculated distance is not less than the distance threshold as obstacle points in the first grid.
[0155] The distance threshold is determined based on the flatness of the plane described by the generated plane parameters.
[0156] For a plane with good flatness, the distance threshold can be set relatively small; for a plane with poor flatness, the distance threshold can be set relatively large. Figure 8 As shown in the figure, the height difference between different ground points on plane 4 with better flatness is smaller. When judging whether the point cloud is a ground point on plane 4, a smaller distance threshold can be set to avoid low obstacles being misjudged as ground points when the distance threshold is larger. The height difference between different ground points on plane 5 with poor flatness is larger. If a smaller distance threshold is set for plane 5, some ground points may be misjudged as obstacle points, resulting in ground point omission. Therefore, when judging whether the point cloud is a ground point on plane 5, a larger distance threshold can be set.
[0157] In a possible implementation manner, the distance threshold may be determined according to the following expression:
[0158] ;
[0159] Wherein, threshold is the distance threshold, α is the first preset coefficient, th is the default distance threshold, and max(,) is the maximum value of the two numbers in the brackets. is the second preset coefficient, exp() is an exponential function with the natural constant e as the base, flag_value is the flatness, th flat is the flatness threshold. α can be set to 2, α,th, and flat It can be adjusted according to actual needs.
[0160] According to this expression, a stable mapping relationship between flatness and distance threshold can be established to ensure that there will be no large error in the result of each point cloud classification, and thus the drivable area segmented according to the point cloud classification result will be more stable.
[0161] Since the flatness of each plane is different, the determined distance threshold may also be different. For each point cloud in the first grid, the electronic device can determine whether the obtained distance is less than the distance threshold of the corresponding plane based on the distance from the point cloud to each plane in the first grid obtained in step S701. When any distance is less than the distance threshold of the corresponding plane, the electronic device can classify the point cloud as a ground point in the first grid, and when any distance is greater than or equal to the distance threshold of the corresponding plane, the electronic device can classify the point cloud as an obstacle point in the first grid, that is, a non-ground point.
[0162] Step S703: segmenting a drivable area from the first grid based on the point cloud classification result.
[0163] The electronic device can represent all the obstacle points obtained by classification as occupied grids. That is, the grids with obstacle points are marked as occupied, and the grids without obstacle points are not marked, so that the electronic device can divide the grids that are not marked as occupied into drivable areas.
[0164] Above Figure 7 In the described technical solution, the distance threshold for point cloud classification is dynamically adjusted based on the flatness of the plane. A smaller distance threshold is set for flat ground with good flatness, which can avoid some low obstacle point clouds being misclassified as ground points. A larger distance threshold is set for ground with poor flatness and certain undulations, which can avoid missing ground points, thereby improving the accuracy of point cloud classification and further improving the accuracy of drivable area segmentation.
[0165] For the uneven ground mentioned in the above step S102, the embodiment of the present application further provides the following implementation method for detecting whether the ground in the first grid is uneven ground, such as: Fig. 9 The flowchart of uneven ground detection is shown in FIG. 1 , and the implementation method may include the following steps S901 - S903 .
[0166] S901, performing plane fitting based on a first point cloud in a first grid to obtain plane parameters of the fitted plane.
[0167] The first point cloud can be the N point clouds with the lowest height in the first grid, which can be determined based on the height attribute value of the point cloud. Among them, N can be adjusted according to the size of the first grid actually divided and the density of the point cloud in the first grid. The electronic device can perform plane fitting based on the first point cloud in the first grid using a common plane fitting method to obtain the plane equation, plane center point coordinates, singular vectors, etc. of the fitted plane. Common plane fitting methods can refer to the plane fitting methods listed in the relevant description of step S102, which will not be repeated here.
[0168] S902, obtaining the flatness of the fitted plane according to the obtained plane parameters.
[0169] When performing plane fitting, the electronic device performs singular value decomposition on the matrix composed of the selected multiple point clouds to obtain singular vectors and corresponding singular values. The electronic device can use the obtained minimum singular value as the flatness of the fitted plane.
[0170] S903: Use the obtained flatness to detect whether the ground in the first grid is uneven.
[0171] The electronic device can determine whether the ground in the first grid is a flat ground by judging whether the obtained flatness is greater than a set flatness threshold. When the flatness is greater than the set flatness threshold, the electronic device can determine that the ground in the first grid is a flat ground, and when the flatness is less than or equal to the set flatness threshold, the electronic device can determine that the ground in the first grid is an uneven ground.
[0172] Above Fig. 9 In the described technical solution, based on plane fitting of the point cloud in the first grid, the flatness of the fitted plane is obtained, and then based on the flatness, it is judged whether the ground in the first grid is a flat ground. This can more accurately determine the uneven ground and avoid the subsequent drivable area segmentation operation on the flat ground, which leads to a waste of computing resources.
[0173] Regarding the determination of the connectivity attributes of the point cloud in the above step S101, the present application embodiment also provides an implementation method, such as Fig.10 The detailed flow chart of step S101 shown in the figure, the implementation method may include the following steps S1001-S1003.
[0174] S1001, selecting a sixth point cloud with the lowest height from the point cloud of the third grid in the scanning area.
[0175] The third grid is any sub-area obtained by dividing the scanning area of the radar. The electronic device can select a specified number of sixth point clouds with the lowest height from the point cloud of the third grid according to the height attribute of the point cloud to achieve downsampling of the point cloud. The specified number can be determined based on the actual size of the divided third grid and the point cloud density. When determining the first point cloud from the first grid in the subsequent step, the sixth point cloud in the first grid can also be determined, so there is no need to re-select the point cloud, reducing the amount of calculation.
[0176] In a possible implementation, the third grid may be divided as follows: each radial region is divided into sub-regions using a circular ring along the scanning tangent direction. The radial region is a region obtained by dividing the scanning region from the scanning center, along the scanning radial direction, and at the same azimuth angle. The scanning center is the center of the radar.
[0177] For example, Fig.11 As shown in the figure, the radar scanning area with a radius of r is divided into 2π / Δα sectors, which are denoted as S0, S1, ..., S 2π / Δα-1 , Δα is the angle of each sector area, each sector area is a radial area, and each radial area is divided into B sub-areas using a ring along the scanning tangent and with the radar center as the center, which are recorded as b1, ..., b B , each sub-region is a third grid. For each third grid, the tangent index s of the third grid can be determined according to the following expression:
[0178] ;
[0179] Among them, p i is any point cloud in the third grid, x i ,y i They are point clouds p i The two Cartesian coordinates of Indicates that the parameters are rounded down, atan2(y i ,x i ) represents the point cloud p i azimuth.
[0180] The radial index b of each third grid can be determined according to the grid number of the third grid in the radial region where the third grid is located.
[0181] The tangent index of the point clouds in the same radial region is the same, and the set P of all point clouds in the radial region with the tangent index s is s It can be expressed as:
[0182] ;
[0183] Among them, p i represents any point cloud in the radial area with tangent index s, and P represents all point clouds scanned by the radar.
[0184] The area between two adjacent rings can be recorded as a bin. The radial index of the point clouds in the same bin is the same. The set P of all point clouds in the bin with radial index b is b It can be expressed as:
[0185] ;
[0186] Among them, p i represents any point cloud in the bin with radial index b, and P represents all point clouds scanned by the radar. and They represent the minimum radius and maximum radius of the bth bin respectively.
[0187] The third grid divided in this way is more in line with the actual radar scanning scene, and the index of each third grid can be determined more conveniently, which is convenient for subsequent scanning of radially adjacent third grids.
[0188] S1002: Based on the sixth point cloud in the adjacent third grid, determine whether the height difference between the point clouds in the adjacent third grid is less than a preset height threshold.
[0189] The adjacent third grids are adjacent along the scanning radial direction. Adjacent along the scanning radial direction means that the two third grids are located in the same scanning radial direction and have a common tangential boundary.
[0190] The electronic device may calculate the difference in height attribute value between each sixth point cloud in the third grid and each sixth point cloud in the adjacent third grid according to the height attribute of the point cloud, and determine whether each difference is less than a preset height threshold. If each difference is less than the preset height threshold, the electronic device may determine that the height difference between the point clouds in the two adjacent third grids is less than the preset height threshold; if there is a difference greater than or equal to the preset height threshold, the electronic device may determine that the height difference between the point clouds in the two adjacent third grids is greater than or equal to the preset height threshold.
[0191] For example, the third grid 1 and the third grid 2 are adjacent along the scanning radial direction, the sixth point cloud in the third grid 1 includes point cloud E and point cloud F, and the sixth point cloud in the third grid 2 includes point cloud G and point cloud H. The electronic device calculates the height difference between point cloud E in the third grid 1 and point cloud G and point cloud H in the third grid 2, respectively, to obtain the height difference between point cloud E and point cloud G, and the height difference between point cloud E and point cloud H; the electronic device also calculates the height difference between point cloud F in the third grid 1 and point cloud G and point cloud H in the third grid 2, respectively, to obtain the height difference between point cloud F and point cloud G, and the height difference between point cloud F and point cloud H. The electronic device determines whether the four obtained height differences are less than the preset height threshold.
[0192] S1003: If the height difference between the point clouds in the adjacent third grids is less than a preset height threshold, determining the connectivity attribute of the point clouds in the adjacent third grids as an attribute that characterizes that the point clouds belong to a connected domain along the scanning radial direction.
[0193] If the height difference between point clouds in the adjacent third grid is less than the preset height threshold, the electronic device can determine that the connectivity attribute of the point cloud in the adjacent third grid is an attribute that characterizes that the point cloud belongs to a connected domain along the scanning radial direction. If the height difference between point clouds in the adjacent third grid is greater than or equal to the preset height threshold, the electronic device can determine that the point cloud in the third grid with a larger radial distance from the radar does not belong to a connected domain along the scanning radial direction.
[0194] For example, the third grid 1, the third grid 2, and the third grid 3 are arranged in sequence along the same scanning radial direction, and the third grid 1 is adjacent to the third grid 2, and the third grid 2 is adjacent to the third grid 3. The distances between the third grid 1, the third grid 2, and the third grid 3 and the radar increase in sequence. If the electronic device determines that the height difference between the point clouds in the third grid 1 and the third grid 2 is less than the preset height threshold, the electronic device can determine that the connectivity attribute of the point clouds in the third grid 1 and the third grid 2 is an attribute that characterizes that the point clouds belong to the connected domain along the scanning radial direction, and sets the value of the connectivity attribute to 1 for all point clouds in the third grid 1 and the third grid 2. If the electronic device determines that the height difference between the point clouds in the third grid 2 and the third grid 3 is greater than the preset height threshold, the electronic device can determine that the point cloud in the third grid 3 does not belong to the connected domain along the scanning radial direction, and the connectivity attribute value of all point clouds in the third grid 3 is the default value 0.
[0195] Above Fig.10 In the described scheme, the connectivity properties of all point clouds in the third grid are determined by dividing the third grid and comparing the height differences of some point clouds between adjacent third grids in the same radial area. There is no need to judge each point cloud separately, which reduces the amount of calculation and saves computing resources.
[0196] In order to more clearly illustrate the above solution, the present application embodiment also provides the following Fig.12 A flow chart is shown.
[0197] Fig.12 In the Fig.11 The radar scanning area is radially segmented in the manner described in the above, and each third grid is represented by a uniform sector using a radial index and a tangential index, as described in the above step S1001; then the electronic device can perform a radial connected domain search based on the divided third grid to determine the connectivity properties of the point cloud in the radially connected third grid, as described in the above steps S1002-S1003.
[0198] Fig.12 In the Figure 3 The radar scanning area is concentrically divided into multiple concentric circle areas in the manner described in the above, and each concentric circle area is further divided into multiple first grids. The electronic device can perform regional ground fitting on each first grid to obtain the plane parameters of the fitted plane, such as the content described in the above step S901. Then, the electronic device can perform ground likelihood estimation based on the plane parameters of the fitted plane to determine whether the fitted plane is a non-flat ground, such as the content described in the above steps S902-S903.
[0199] After determining that the plane fitted by the first grid is a non-flat ground, the electronic device can re-segment the neighborhood ground based on the determined connectivity attributes, that is, use the second grid adjacent to the first grid to realize the judgment of the ground composition in the first grid, and generate the plane parameters of the plane constituting the ground in the first grid, as described in the above steps S102-S104.
[0200] Afterwards, the electronic device uses dynamic threshold point cloud classification and combines the generated plane parameters to segment the drivable area of the first grid, such as steps S701-S703 above.
[0201] By applying the technical solution provided in the embodiment of the present application, the front-back relationship and the connectivity relationship of the point cloud can be rationally confirmed according to the connectivity attributes; and based on the ground in the second grid adjacent to the first grid, the ground in the first grid is re-segmented, which significantly improves complex ground scenes, slope scenes and curb scenes; in addition, the distance threshold can be dynamically adjusted according to the flatness of the ground, and then the point cloud is classified based on the dynamic distance threshold, which further improves the quality of the drivable area segmentation based on the point cloud and reduces the frequency of misjudgment of low objects.
[0202] Corresponding to the above-mentioned drivable area segmentation method, the embodiment of the present application also provides a drivable area segmentation device, such as Fig.13 As shown, the device comprises:
[0203] A first determination module 1301 is used to determine the connectivity attribute of the point cloud in the scanning area of the radar based on the height difference between the point clouds, wherein the connectivity attribute represents whether the point cloud belongs to a connected domain along the scanning radial direction;
[0204] The second determination module 1302 is configured to determine a first base plane where the ground with the lowest height in a second grid adjacent to the first grid is located if it is detected based on the first point cloud in the first grid of the scanning area that the ground in the first grid is uneven;
[0205] A selection module 1303 is used to select a second point cloud belonging to the first base plane from the first point cloud based on the distance between the point cloud and the first base plane, and select a third point cloud belonging to the connected domain from the first point cloud outside the second point cloud;
[0206] A generating module 1304 is used to generate plane parameters of the ground in the first grid using the second point cloud and the third point cloud as ground points;
[0207] The segmentation module 1305 is used to segment the drivable area of the first grid based on the generated plane parameters.
[0208] In the technical solution provided by the embodiment of the present application, when the electronic device detects that the ground in the first grid is not flat based on the first point cloud in the first grid of the scanning area of the radar, it means that the terrain in the first grid is not a simple plane, and the terrain is relatively complex. The electronic device segments the terrain in the first grid to determine the complex terrain in the first grid. The electronic device first selects the second point cloud belonging to the first basic plane and the third point cloud belonging to the connected domain but not the first basic plane from the first point cloud in the first grid based on the first basic plane where the ground with the lowest height in the adjacent second grid is located. The second point cloud and the third point cloud in the first grid are connected, but belong to different planes. The different planes to which the second point cloud and the third point cloud belong are combined into the ground. The electronic device uses the second point cloud and the third point cloud to perform plane fitting respectively, generate the plane parameters of each plane combined into the ground, and then judges whether all the point clouds in the first grid are ground points based on the plane parameters of these planes, so as to achieve the segmentation of the drivable area. In the above scheme, the electronic device can also accurately judge complex terrain, fit multiple planes that constitute the ground in the first grid and obtain the plane parameters of these planes, and segment the point cloud in the first grid into drivable areas based on the fitted multiple planes, thereby improving the accuracy of drivable area segmentation.
[0209] In a possible implementation, the generating module 1304 may be specifically configured to:
[0210] Generate plane parameters of the plane where the first flat ground in the first grid is located based on the second point cloud;
[0211] Determine a second base plane where the ground in the second grid that is higher than the first base plane is located;
[0212] If there is a fourth point cloud belonging to the second base plane in the third point cloud, and a fifth point cloud other than the fourth point cloud in the third point cloud satisfies the preset surface condition, plane parameters of the plane where the second flat ground in the first grid is located are generated based on the fourth point cloud, and plane parameters of the plane where the first slope in the first grid is located are generated based on the fifth point cloud;
[0213] Otherwise, plane parameters of the plane where the second slope in the first grid is located are generated based on the third point cloud.
[0214] In a possible implementation, the segmentation module 1305 may be specifically used to:
[0215] Calculate the distance between each point cloud in the first grid and the plane described by the generated plane parameters;
[0216] Classifying the point cloud whose calculated distance is less than the distance threshold as a ground point in the first grid, and classifying the point cloud whose calculated distance is not less than the distance threshold as an obstacle point in the first grid, wherein the distance threshold is determined based on the flatness of the plane described by the generated plane parameters;
[0217] The drivable area is segmented from the first grid based on the point cloud classification result.
[0218] In a possible implementation, the distance threshold may be determined according to the following expression:
[0219] ;
[0220] Wherein, threshold is the distance threshold, α is the first preset coefficient, th is the default distance threshold, and max(,) is the maximum value of the two numbers in the brackets. is the second preset coefficient, exp() is an exponential function with the natural constant e as the base, flag_value is the flatness, th flat is the flatness threshold.
[0221] In a possible implementation manner, whether the ground in the first grid is uneven ground may be detected in the following manner:
[0222] Performing plane fitting based on the first point cloud in the first grid to obtain plane parameters of the fitted plane;
[0223] Obtaining the flatness of the fitted plane according to the obtained plane parameters;
[0224] The obtained flatness is used to detect whether the ground in the first grid is uneven.
[0225] In a possible implementation manner, the first determining module 1301 may be specifically configured to:
[0226] Select the sixth point cloud with the lowest height from the point cloud of the third grid in the scanning area;
[0227] Based on the sixth point cloud in the adjacent third grid, determining whether the height difference between the point clouds in the adjacent third grid is less than a preset height threshold, wherein the adjacent third grids are adjacent along the scanning radial direction;
[0228] If it is less than, the connectivity attribute of the point cloud in the adjacent third grid is determined to be an attribute that characterizes that the point cloud belongs to a connected domain along the scanning radial direction.
[0229] In a possible implementation manner, the first point cloud in the first grid may be the sixth point cloud in the first grid.
[0230] In a possible implementation, the first grid may be: sub-regions obtained by dividing a first number of concentric circular regions along a scanning radial direction, wherein the concentric circular regions are: regions with the same center obtained by dividing the scanning region according to point cloud density; and / or
[0231] The third grid may be: sub-regions obtained by dividing each radial region using a circular ring along the scanning tangent direction, wherein the radial region is: a region obtained by dividing the scanning region from the scanning center, along the scanning radial direction, and at the same azimuth angle.
[0232] The present application also provides an electronic device, such as Fig.14 As shown, including:
[0233] Memory 1401, used for storing computer programs;
[0234] The processor 1402 is used to implement the steps of any of the above-mentioned drivable area segmentation methods when executing the program stored in the memory 1401.
[0235] In addition, the electronic device may further include a communication bus and / or a communication interface, and the processor 1402, the communication interface, and the memory 1401 communicate with each other via the communication bus.
[0236] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0237] The communication interface is used for communication between the above electronic device and other devices.
[0238] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0239] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0240] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned drivable area segmentation methods are implemented.
[0241] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any of the drivable area segmentation methods in the above embodiments.
[0242] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0243] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0244] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0245] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A drivable area segmentation method, characterized in that: The method comprises: Determine the connectivity attribute of the point cloud in the scanning area of the radar based on the height difference between the point clouds, wherein the connectivity attribute indicates whether the point cloud belongs to a connected domain along the scanning radial direction; If it is detected based on the first point cloud in the first grid of the scanning area that the ground in the first grid is uneven, determining a first base plane where the ground with the lowest height in a second grid adjacent to the first grid is located; Based on the distance between the point cloud and the first base plane, selecting a second point cloud belonging to the first base plane from the first point cloud, and selecting a third point cloud belonging to the connected domain from the first point cloud outside the second point cloud; Generate plane parameters of the plane where the first flat ground in the first grid is located based on the second point cloud; Determine a second base plane in the second grid where the ground that is higher than the first base plane is located; If there is a fourth point cloud belonging to the second base plane in the third point cloud, and a fifth point cloud other than the fourth point cloud in the third point cloud satisfies a preset surface condition, plane parameters of a plane where the second flat ground in the first grid is located are generated based on the fourth point cloud, and plane parameters of a plane where the first slope in the first grid is located are generated based on the fifth point cloud; otherwise, generating plane parameters of the plane where the second slope in the first grid is located based on the third point cloud; Calculating the distance between each point cloud in the first grid and the plane described by the generated plane parameters; Classifying the point cloud whose calculated distance is less than a distance threshold as a ground point in the first grid, and classifying the point cloud whose calculated distance is not less than the distance threshold as an obstacle point in the first grid, wherein the distance threshold is determined based on the flatness of the plane described by the generated plane parameters; The drivable area is segmented from the first grid based on the point cloud classification result.
2. The method according to claim 1, characterized in that The distance threshold is determined according to the following expression: ; Wherein, threshold is the distance threshold, α is the first preset coefficient, th is the default distance threshold, and max(,) is the maximum value of the two numbers in the brackets. is the second preset coefficient, exp() is an exponential function with the natural constant e as the base, flag_value is the flatness, th flat is the flatness threshold.
3. The method according to claim 1, characterized in that: Whether the ground in the first grid is uneven is detected in the following manner: Performing plane fitting based on the first point cloud in the first grid to obtain plane parameters of the fitted plane; Obtaining the flatness of the fitted plane according to the obtained plane parameters; The obtained flatness is used to detect whether the ground in the first grid is uneven.
4. The method according to any one of claims 1 to 3, characterized in that The step of determining the connectivity attributes of the point clouds in the scanning area of the radar based on the height difference between the point clouds includes: Selecting a sixth point cloud with the lowest height from the point cloud of the third grid in the scanning area; Based on the sixth point cloud in the adjacent third grid, determining whether the height difference between the point clouds in the adjacent third grid is less than a preset height threshold, wherein the adjacent third grids are adjacent along the scanning radial direction; If it is less than, the connectivity attribute of the point cloud in the adjacent third grid is determined to be an attribute that characterizes that the point cloud belongs to a connected domain along the scanning radial direction.
5. The method according to claim 4, characterized in that The first point cloud in the first grid is the sixth point cloud in the first grid.
6. The method according to claim 4, characterized in that The first grid is: sub-areas obtained by dividing a first number of concentric circle areas along the scanning radial direction, wherein the concentric circle areas are: areas with the same center obtained by dividing the scanning area according to the point cloud density; and / or The third grid is: sub-areas obtained by dividing each radial area using a circular ring along the scanning tangent direction, wherein the radial area is: an area obtained by dividing the scanning area from the scanning center, along the scanning radial direction, and at the same azimuth angle.
7. A drivable area segmentation device, characterized in that: The device comprises: A first determination module is used to determine the connectivity attribute of the point cloud in the scanning area of the radar based on the height difference between the point clouds, wherein the connectivity attribute represents whether the point cloud belongs to a connected domain along the scanning radial direction; A second determination module is configured to determine a first base plane where the ground with the lowest height in a second grid adjacent to the first grid is located if it is detected based on the first point cloud in the first grid of the scanning area that the ground in the first grid is uneven; A selection module, configured to select a second point cloud belonging to the first base plane from the first point cloud based on the distance between the point cloud and the first base plane, and select a third point cloud belonging to the connected domain from the first point cloud outside the second point cloud; A generation module, used to generate plane parameters of a plane where a first flat ground in the first grid is located based on the second point cloud; determine a second base plane where a ground higher than the first base plane is located in the second grid; if there is a fourth point cloud belonging to the second base plane in the third point cloud, and a fifth point cloud other than the fourth point cloud in the third point cloud satisfies a preset surface condition, then generate plane parameters of a plane where a second flat ground in the first grid is located based on the fourth point cloud, and generate plane parameters of a plane where a first slope in the first grid is located based on the fifth point cloud; otherwise, generate plane parameters of a plane where a second slope in the first grid is located based on the third point cloud; A segmentation module is used to calculate the distance between each point cloud in the first grid and the plane described by the generated plane parameters; classify the point cloud whose calculated distance is less than the distance threshold as a ground point in the first grid, and classify the point cloud whose calculated distance is not less than the distance threshold as an obstacle point in the first grid, wherein the distance threshold is determined based on the flatness of the plane described by the generated plane parameters; and segment the drivable area from the first grid based on the point cloud classification result.
8. The device according to claim 7, characterized in that The distance threshold is determined according to the following expression: ; Wherein, threshold is the distance threshold, α is the first preset coefficient, th is the default distance threshold, and max(,) is the maximum value of the two numbers in the brackets. is the second preset coefficient, exp() is an exponential function with the natural constant e as the base, flag_value is the flatness, th flat is the flatness threshold.
9. The device according to claim 7, characterized in that Whether the ground in the first grid is a non-flat ground is detected in the following manner: plane fitting is performed based on the first point cloud in the first grid to obtain plane parameters of the fitted plane; the flatness of the fitted plane is obtained according to the obtained plane parameters; and the obtained flatness is used to detect whether the ground in the first grid is a non-flat ground.
10. The device according to any one of claims 7 to 9, characterized in that: The first determination module is specifically used to: select the sixth point cloud with the lowest height from the point cloud of the third grid in the scanning area; based on the sixth point cloud in the adjacent third grid, determine whether the height difference between the point clouds in the adjacent third grids is less than a preset height threshold, wherein the adjacent third grids are adjacent along the scanning radial direction; if less than, determine that the connectivity attribute of the point cloud in the adjacent third grid is an attribute that characterizes that the point cloud belongs to a connected domain along the scanning radial direction.
11. The device according to claim 10, characterized in that The first point cloud in the first grid is the sixth point cloud in the first grid.
12. The device according to claim 10, characterized in that The first grid is: sub-regions obtained by dividing a first number of concentric circle regions along the scanning radial direction, wherein the concentric circle regions are: regions with the same center obtained by dividing the scanning area according to point cloud density; and / or, the third grid is: sub-regions obtained by dividing each radial region using a circular ring along the scanning tangent direction, wherein the radial region is: a region obtained by dividing the scanning area from the scanning center, along the scanning radial direction, and according to the same azimuth angle.
13. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing the steps of the method described in any one of claims 1 to 6 when executing a program stored in a memory.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
