Multi-dimensional gradient ground point extraction method and device
By performing multi-dimensional gradient processing on point cloud data, including slope filtering, height filtering and external point filtering, the accuracy of ground point extraction and computing resource consumption in complex terrain is solved, and more efficient ground point extraction is achieved.
Patent Information
- Application Number
- CN202411995272.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
In complex terrain, traditional ground point extraction methods are difficult to accurately extract ground points, and the point cloud data generated by lidar is huge, and the processing time and computing resources are consumed relatively large.
A multi-dimensional gradient ground point extraction method is used, including slope filtering, height filtering, sector-shaped area division and outer point filtering of point cloud data, and finally extracting ground points based on the constructed ground model.
Effectively filter noise and outliers, improve ground extraction accuracy, and reduce computing resource consumption.
Smart Images

Figure CN119919904A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of vehicle ground point extraction, and in particular to a multi-dimensional gradient ground point extraction method and device. Background Art
[0002] In the process of laser point cloud detection, the acquired point cloud data is often relatively large. Performing ground point detection on the point cloud can effectively extract the ground points from the entire point cloud data set.
[0003] Ground extraction methods are divided into threshold-based methods, shape-based methods, and statistics-based methods. Height threshold-based screening is the simplest ground point cloud extraction method. By setting a height threshold, points greater than the threshold are considered non-ground points, and points less than the threshold are considered ground points. This method is suitable for relatively flat scenes without obvious height changes. Shape features based on the ground plane is another common ground point cloud extraction method. When calculating the normal vector of each point and its neighboring points, this method determines whether the point belongs to the ground by comparing the difference between the normal vector and the given threshold. This method is more suitable for complex terrain scenes.
[0004] However, in complex terrains (such as mountains, hills, cities, etc.), the ground is often not flat, but has various slopes, potholes and obstacles. Traditional methods often have difficulty accurately extracting ground points in these complex terrains. Moreover, the point cloud data generated by LiDAR is usually very large, and it takes a lot of time and computing resources to process it. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a multi-dimensional gradient ground point extraction method and device.
[0006] A first aspect of an embodiment of the present disclosure provides a multi-dimensional gradient ground point extraction method, the method comprising:
[0007] Perform slope filtering on the point cloud data to be processed to obtain filtered first point cloud data;
[0008] Performing a high degree of filtering on the first point cloud data to obtain filtered second point cloud data;
[0009] Dividing the second point cloud data into sector-shaped areas, and performing external point filtering processing on each sector-shaped area to obtain third point cloud data;
[0010] A ground model is constructed based on the third point cloud data, and ground points are extracted according to the ground model.
[0011] In one example, performing slope filtering on the point cloud data to be processed to obtain filtered first point cloud data includes:
[0012] In the spatial coordinate system, the slope is calculated based on the three-dimensional coordinates of each point cloud in the point cloud data to be processed, and the slope tangent value corresponding to each point cloud is obtained;
[0013] The point cloud corresponding to the slope tangent value being less than the slope threshold is retained to obtain the first point cloud data.
[0014] In one example, the method further includes:
[0015] For the point cloud whose slope tangent value is less than the slope threshold, determine whether the abscissa and ordinate of the point cloud are less than the minimum abscissa and the minimum ordinate, or greater than the maximum abscissa and the maximum ordinate;
[0016] If the abscissa and the ordinate of the point cloud are less than the minimum abscissa and the minimum ordinate, updating the minimum abscissa and the minimum ordinate;
[0017] If the horizontal coordinate and the vertical coordinate of the point cloud are greater than the maximum horizontal coordinate and the maximum vertical coordinate, the maximum horizontal coordinate and the maximum vertical coordinate are updated.
[0018] In one example, the performing a high degree filtering process on the first point cloud data to obtain filtered second point cloud data includes:
[0019] Gridding the first point cloud data based on a spatial coordinate system to obtain a plurality of grids;
[0020] Minimum height point cloud filtering is performed on multiple point clouds of each grid to obtain the second point cloud data.
[0021] In one example, performing minimum height point cloud filtering on multiple point clouds of each grid to obtain the second point cloud data includes:
[0022] Traverse and calculate the grid indexes to which all point clouds belong, and determine the minimum vertical coordinate of each grid;
[0023] For the multiple point clouds of each grid, the point clouds corresponding to the vertical coordinates not exceeding the preset difference value with the minimum vertical coordinate are retained to obtain the second point cloud data.
[0024] In one example, dividing the second point cloud data into sector areas includes:
[0025] Converting the second point cloud data from a spatial coordinate system into a polar coordinate system;
[0026] The second point cloud data is divided into sector-shaped areas based on the polar coordinate system to obtain a corresponding plurality of sector-shaped areas.
[0027] In one example, external point filtering is performed on each sector area to obtain third point cloud data, including:
[0028] Based on the random sampling consensus algorithm, plane fitting is performed on the minimum point cloud sample selected in each sector area to obtain a plane model;
[0029] Calculating the error between the remaining point cloud and the plane model to determine the outer point cloud and the inner point cloud;
[0030] A target plane model is determined based on the number of the inner point clouds, and corresponding third point cloud data is determined based on the target plane model.
[0031] In one example, constructing a ground model based on the third point cloud data and extracting ground points according to the ground model includes:
[0032] Performing surface fitting on the third point cloud data based on the least squares method to obtain a surface equation;
[0033] The surface equation is solved based on Gaussian elimination method, the ground model is constructed, and ground points are extracted according to the ground model.
[0034] A second aspect of an embodiment of the present disclosure provides a multi-dimensional gradient ground point extraction device, the device comprising:
[0035] A first processing module is used to perform slope filtering on the point cloud data to be processed to obtain filtered first point cloud data;
[0036] A second processing module, used for performing a high degree of filtering on the first point cloud data to obtain filtered second point cloud data;
[0037] a third processing module, configured to divide the second point cloud data into sector-shaped areas, and perform external point filtering processing on each sector-shaped area to obtain third point cloud data;
[0038] A data extraction module is used to construct a ground model based on the third point cloud data and extract ground points according to the ground model.
[0039] A third aspect of an embodiment of the present disclosure provides a vehicle, the server comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method of the first aspect above.
[0040] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.
[0041] The disclosed embodiment provides a multi-dimensional gradient ground point extraction method and device, the method comprising: performing slope filtering on the point cloud data to be processed to obtain the first filtered point cloud data, then performing height filtering on the first point cloud data to obtain the second filtered point cloud data, then dividing the second point cloud data into fan-shaped areas, and performing external point filtering on each fan-shaped area to obtain third point cloud data, and finally constructing a ground model based on the third point cloud data, and extracting ground points based on the ground model. By adopting this technical solution, it is possible to perform slope filtering and height filtering on the point cloud data, then perform external point filtering in the fan-shaped area, and finally construct a ground model, thereby effectively filtering noise and outliers, extracting more accurate ground points, and improving the accuracy of ground extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0043] In order to more clearly illustrate the embodiments of the present invention 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 It is a flowchart of a multi-dimensional gradient ground point extraction method provided by an embodiment of the present disclosure;
[0045] Figure 2 It is a flowchart of another multi-dimensional gradient ground point extraction method provided by an embodiment of the present disclosure;
[0046] Figure 3 is a schematic structural diagram of a spatial coordinate system provided by an embodiment of the present disclosure;
[0047] Figure 4 It is a flowchart of another multi-dimensional gradient ground point extraction method provided by an embodiment of the present disclosure;
[0048] Figure 5 It is a flowchart of another multi-dimensional gradient ground point extraction method provided by an embodiment of the present disclosure;
[0049] Figure 6It is a structural schematic diagram of a multi-dimensional gradient ground point extraction device provided by an embodiment of the present disclosure;
[0050] Figure 7 It is a structural schematic diagram of a vehicle in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0053] Figure 1 The present invention provides a flowchart of a multi-dimensional gradient ground point extraction method, which can be performed by an electronic device. The electronic device may include but is not limited to a vehicle-mounted device, a vehicle controller, and the like.
[0054] like Figure 1 As shown, the method provided in this embodiment includes the following steps:
[0055] S110 , performing slope filtering processing on the point cloud data to be processed to obtain filtered first point cloud data.
[0056] In the embodiment of the present disclosure, the electronic device may perform slope filtering on the point cloud data to be processed to obtain filtered first point cloud data.
[0057] Optionally, the point cloud data to be processed may be point cloud data that needs to be extracted from the ground obtained by a laser radar.
[0058] Optionally, the first point cloud data may be point cloud data obtained after slope filtering.
[0059] Specifically, after acquiring the point cloud data to be processed, the electronic device may perform slope filtering on the point cloud data to be processed, that is, filter the point cloud data according to the slopes corresponding to multiple point clouds in the point cloud data to be processed to obtain filtered first point cloud data.
[0060] S120: Perform height filtering processing on the first point cloud data to obtain filtered second point cloud data.
[0061] In the embodiment of the present disclosure, the electronic device may perform a high degree of filtering on the first point cloud data to obtain filtered second point cloud data.
[0062] Optionally, the second point cloud data may be point cloud data obtained after height filtering.
[0063] Specifically, after performing slope filtering processing to obtain first point cloud data, the electronic device may continue to perform height filtering processing on the first point cloud data, that is, filtering according to the heights corresponding to multiple point clouds in the first point cloud data to obtain filtered second point cloud data.
[0064] S130, dividing the second point cloud data into sector-shaped areas, and performing external point filtering processing on each sector-shaped area to obtain third point cloud data.
[0065] In an embodiment of the present disclosure, the electronic device may divide the second point cloud data into sector-shaped areas, and perform external point filtering processing on each sector-shaped area to obtain third point cloud data.
[0066] Optionally, the sector-shaped area division may be dividing the point cloud data into a plurality of sector-shaped areas.
[0067] Optionally, the third point cloud data may be point cloud data obtained after external point filtering.
[0068] Specifically, after the electronic device performs a high-level filtering process to obtain the second point cloud data, it can continue to perform sector-shaped area division on the second point cloud data, that is, divide the second point cloud data into multiple sector-shaped areas, and then perform external point filtering processing on each sector-shaped area, that is, filter the point cloud outside the normal range to obtain the third point cloud data.
[0069] S140: construct a ground model based on the third point cloud data, and extract ground points according to the ground model.
[0070] In an embodiment of the present disclosure, the electronic device may construct a ground model based on the third point cloud data, and extract ground points according to the ground model.
[0071] Specifically, after obtaining the third point cloud data, the electronic device can construct a corresponding ground model according to the third point cloud data, and then extract corresponding ground points according to the ground model.
[0072] Therefore, in the disclosed embodiment, the point cloud data to be processed is subjected to slope filtering to obtain the first filtered point cloud data, and then the first point cloud data is subjected to height filtering to obtain the second filtered point cloud data, and then the second point cloud data is divided into fan-shaped areas, and external point filtering is performed on each fan-shaped area to obtain the third point cloud data, and finally a ground model is constructed based on the third point cloud data, and ground points are extracted according to the ground model. By adopting this technical solution, it is possible to perform slope filtering and height filtering on the point cloud data, and then perform external point filtering in the fan-shaped area, and finally construct a ground model, thereby effectively filtering noise and outliers, extracting more accurate ground points, and improving the accuracy of ground extraction.
[0073] Figure 2 It is a flowchart of another multi-dimensional gradient ground point extraction method provided by an embodiment of the present disclosure.
[0074] like Figure 2 As shown, the method provided in this embodiment includes the following steps:
[0075] S210 . In the spatial coordinate system, calculate the slope based on the three-dimensional coordinates of each point cloud in the point cloud data to be processed, and obtain the slope tangent value corresponding to each point cloud.
[0076] In an embodiment of the present disclosure, in a spatial coordinate system, the electronic device can perform slope calculation based on the three-dimensional coordinates of each point cloud in the point cloud data to be processed to obtain a slope tangent value corresponding to each point cloud.
[0077] Optionally, three-dimensional coordinates (x, y, z) can be used to represent the coordinate position of each point cloud in the spatial coordinate system.
[0078] Optionally, the slope tangent value may be used to characterize the ratio of the vertical change rate of the ground surface at the point cloud to the horizontal distance.
[0079] Figure 3 It is a structural schematic diagram of a spatial coordinate system provided by an embodiment of the present disclosure.
[0080] like Figure 3 As shown, the electronic device can determine the three-dimensional coordinates (x, y, z) of each point cloud in the point cloud data to be processed, and calculate the slope tangent value corresponding to each point cloud:
[0081]
[0082] Among them, z represents the vertical coordinate of the point cloud, that is, the vertical position coordinate, while x and y represent the horizontal coordinate and ordinate of the point cloud, that is, the horizontal position coordinate. Indicates the horizontal distance from the point cloud to the coordinate origin.
[0083] S220: retain the point cloud corresponding to the slope tangent value being less than the slope threshold, to obtain the first point cloud data.
[0084] In an embodiment of the present disclosure, the electronic device may retain the point cloud corresponding to the slope tangent value being less than the slope threshold value to obtain the first point cloud data.
[0085] Optionally, the slope threshold (inclination_tangent) may be a preset threshold.
[0086] Specifically, the electronic device can pre-set a slope threshold (inclination_tangent), then compare the slope tangent value corresponding to each point cloud with the slope threshold, and retain the point cloud corresponding to the slope tangent value less than the slope threshold to obtain the first point cloud data, and return the number of filtered points.
[0087] Optionally, the multi-dimensional gradient ground point extraction method may also include: for the point cloud corresponding to the slope tangent value less than the slope threshold, judging whether the horizontal coordinate and the vertical coordinate of the point cloud are less than the minimum horizontal coordinate and the minimum vertical coordinate, or greater than the maximum horizontal coordinate and the maximum vertical coordinate; if the horizontal coordinate and the vertical coordinate of the point cloud are less than the minimum horizontal coordinate and the minimum vertical coordinate, updating the minimum horizontal coordinate and the minimum vertical coordinate; if the horizontal coordinate and the vertical coordinate of the point cloud are greater than the maximum horizontal coordinate and the maximum vertical coordinate, updating the maximum horizontal coordinate and the maximum vertical coordinate.
[0088] In an embodiment of the present disclosure, the electronic device can determine, for the point cloud corresponding to the slope tangent value being less than the slope threshold, whether the horizontal coordinate and vertical coordinate of the point cloud are less than the minimum horizontal coordinate and the minimum vertical coordinate, or greater than the maximum horizontal coordinate and the maximum vertical coordinate.
[0089] Optionally, the minimum horizontal coordinate (grid_min_x), the minimum vertical coordinate (grid_min_y), the maximum horizontal coordinate (grid_max_x), and the maximum vertical coordinate (grid_max_y) respectively represent the boundaries of the horizontal coordinate and the vertical coordinate after filtering.
[0090] Specifically, for the point cloud corresponding to the slope tangent value less than the slope threshold, the electronic device can respectively determine whether the horizontal coordinate of the point cloud is less than the minimum horizontal coordinate (grid_min_x) or greater than the maximum horizontal coordinate (grid_max_x), and determine whether the vertical coordinate of the point cloud is less than the minimum vertical coordinate (grid_min_y) or greater than the maximum vertical coordinate (grid_max_y).
[0091] In some embodiments, if the horizontal coordinate and the vertical coordinate of the point cloud are smaller than the minimum horizontal coordinate and the minimum vertical coordinate, the electronic device may update the minimum horizontal coordinate and the minimum vertical coordinate.
[0092] Specifically, when the horizontal coordinate of the point cloud is less than the minimum horizontal coordinate (grid_min_x), the electronic device can update the minimum horizontal coordinate (grid_min_x) to the horizontal coordinate, and when the vertical coordinate of the point cloud is less than the minimum vertical coordinate (grid_min_y), the electronic device can update the minimum vertical coordinate (grid_min_y) to the vertical coordinate.
[0093] In some other embodiments, if the horizontal coordinate and the vertical coordinate of the point cloud are greater than the maximum horizontal coordinate and the maximum vertical coordinate, the electronic device may update the maximum horizontal coordinate and the maximum vertical coordinate.
[0094] Specifically, when the horizontal coordinate of the point cloud is greater than the maximum horizontal coordinate (grid_max_x), the electronic device can update the maximum horizontal coordinate (grid_max_x) to the horizontal coordinate, and when the vertical coordinate of the point cloud is greater than the maximum vertical coordinate (grid_max_y), the electronic device can update the maximum vertical coordinate (grid_max_y) to the vertical coordinate.
[0095] Figure 4 It is a flow chart of another multi-dimensional gradient ground point extraction method provided in an embodiment of the present disclosure.
[0096] like Figure 4 As shown, the method provided in this embodiment includes the following steps:
[0097] S410 , gridding the first point cloud data based on a spatial coordinate system to obtain a plurality of grids.
[0098] In an embodiment of the present disclosure, the electronic device may grid the first point cloud data based on a spatial coordinate system to obtain a plurality of grids.
[0099] Specifically, the electronic device grids the first point cloud data based on the spatial coordinate system. For example, the boundary of the valid point cloud value is set to lidar_border = [-15.0, 0.0, -5.0, 15.0, 80.0, 5.0], indicating that the boundary value of the x-axis in the left and right directions of the vehicle is [-15.0, 15.0], the boundary value of the y-axis in the forward direction of the vehicle is [0.0, 80.0], and the boundary value of the z-axis in the height direction is [-5.0, 5.0]. The grid size grid_res_ is defined as 1.0, thereby dividing it into multiple grids.
[0100] S420 , performing minimum height point cloud filtering on multiple point clouds of each grid to obtain the second point cloud data.
[0101] In an embodiment of the present disclosure, the electronic device may perform minimum height point cloud filtering on multiple point clouds of each grid to obtain the second point cloud data.
[0102] Specifically, the electronic device may perform minimum height point cloud filtering on multiple point clouds of each grid. For example, the electronic device may perform minimum height point cloud filtering based on the heights of multiple point clouds, thereby obtaining second point cloud data.
[0103] Optionally, S420 may specifically include: traversing and calculating the grid indexes to which all point clouds belong, and determining the minimum vertical coordinate of each grid; for multiple point clouds of each grid, retaining the point clouds whose vertical coordinates are not more than a preset difference value from the minimum vertical coordinate, to obtain the second point cloud data.
[0104] In an embodiment of the present disclosure, the electronic device may traverse and calculate the grid indexes to which all point clouds belong, and determine the minimum vertical coordinate of each grid.
[0105] Specifically, the electronic device can initialize the grid minimum height table grid_min_table, which is an array used to store the minimum height within each grid unit, use grid_sum_num_ to record the total number of grids, then traverse each point cloud, calculate the grid index to which all point clouds belong, and determine the minimum vertical coordinate of each grid.
[0106] Furthermore, the electronic device may retain, for each grid of multiple point clouds, point clouds corresponding to which the vertical coordinates do not exceed a preset difference value with the minimum vertical coordinate to obtain the second point cloud data.
[0107] Optionally, the preset difference value may be a pre-set difference value, for example, the preset difference value may be 0.1f, 0.2f, etc., which is not limited here.
[0108] Specifically, the electronic device can traverse multiple point clouds of each grid, and compare the vertical coordinate of each point cloud with the minimum vertical coordinate, retain the point cloud whose vertical coordinate does not exceed a preset difference value with the minimum vertical coordinate, copy the point to the beginning of the data array, and update the pos variable to track the number of copied points, thereby obtaining the second point cloud data, and returning the number of points retained after filtering.
[0109] Optionally, S130 may specifically include: converting the second point cloud data from a spatial coordinate system into a polar coordinate system; and dividing the second point cloud data into sector-shaped areas based on the polar coordinate system to obtain a corresponding plurality of sector-shaped areas.
[0110] In the embodiment of the present disclosure, the electronic device may convert the second point cloud data from a spatial coordinate system into a polar coordinate system.
[0111] Specifically, the electronic device creates a point cloud object cloud of the PointCloud type, which is used to store the point cloud in the spatial rectangular coordinate system, and a point cloud object cloud_with_pol, which is used to store the converted polar coordinate data, and converts it to the Vector3f type for vector operations, calculates the distance from the point cloud to the origin, i.e., the radius r, and calculates the angle θ between the line connecting the point cloud and the origin and the positive direction of the x-axis. The atan2 function is used to process the angle calculation of all four quadrants, and can correctly handle the special case of y=0 and return the accurate θ value. The converted polar coordinate data is stored in the components of the normal vector, x pol Store r*cos(θ), that is, the x component in polar coordinates, which is actually the projection of the radial component on the x-axis, y pol Store r*sin(θ), which is the y component in polar coordinates. It is actually the projection of the radial component on the y axis. pol The z coordinate value of the origin is directly stored, because the polar coordinate transformation is performed in a two-dimensional plane and the z coordinate remains unchanged. The position of each point cloud is represented by the radius r, polar angle θ and height z.
[0112] Furthermore, the electronic device may divide the second point cloud data into sector-shaped areas based on the polar coordinate system to obtain a corresponding plurality of sector-shaped areas.
[0113] Specifically, the electronic device can be implemented by dividing the polar angle θ by the angular range of each sector area, and then determining the sector area to which the point belongs based on the quotient, traversing each concentric area, and then traversing each sector area in each concentric area, and for each point, assigning it to the corresponding sector area based on its radius r and polar angle θ.
[0114] Optionally, S130 may also specifically include: performing plane fitting on the minimum point cloud sample selected in each fan-shaped area based on a random sampling consensus algorithm to obtain a plane model; calculating the error between the remaining point cloud and the plane model to determine the outer point cloud and the inner point cloud; determining the target plane model based on the number of the inner point cloud, and determining the corresponding third point cloud data based on the target plane model.
[0115] In an embodiment of the present disclosure, the electronic device may perform plane fitting on the minimum point cloud sample selected in each sector area based on a random sampling consensus algorithm to obtain a plane model.
[0116] Specifically, for each sector-shaped area, the electronic device can extract all the data points in the area based on the random sampling consensus algorithm (RANSAC), and use them as the input of the RANSAC algorithm, randomly select the minimum point cloud sample from the data points in the sector-shaped area, and use the minimum point cloud sample to fit a plane, that is, solve the coefficients A, B, C and d in the plane equation Ax+By+Cz+d=0, where A, B, C and d are the coefficients of the plane, x, y and z are the point cloud coordinates in the spatial coordinate system, to obtain the corresponding plane model.
[0117] Furthermore, the electronic device may calculate the error between the remaining point cloud and the plane model to determine the outer point cloud and the inner point cloud.
[0118] Specifically, the electronic device can calculate the error between the remaining point cloud and the plane model, and determine whether the remaining point cloud is an external point cloud or an internal point cloud. The internal point cloud may be a point cloud within the range of the plane model, and the external point cloud may be a point cloud not within the range of the plane model.
[0119] Furthermore, the electronic device may determine a target plane model based on the number of the inner point clouds, and determine corresponding third point cloud data based on the target plane model.
[0120] Specifically, the electronic device can determine the target plane model based on the number of the inner point cloud, that is, after determining the outer point cloud and the inner point cloud, the electronic device counts the number of inner point clouds, takes the plane model with the largest number of inner point clouds as the target plane model, and determines the corresponding third point cloud data based on the target plane model.
[0121] Therefore, using RANSAC to perform plane fitting in the fan-shaped area can extract the plane features of the local area. Through local plane fitting, the local feature structure in the fan-shaped area can be accurately identified and extracted, making the binary quadratic equation fitting more focused on other complex or unknown surfaces. Removing external points through local fitting is more beneficial to quadratic fitting.
[0122] Optionally, S140 may specifically include: performing surface fitting on the third point cloud data based on the least squares method to obtain a surface equation; solving the surface equation based on the Gaussian elimination method to construct the ground model, and extracting ground points based on the ground model.
[0123] In an embodiment of the present disclosure, the electronic device may perform surface fitting on the third point cloud data based on the least squares method to obtain a surface equation.
[0124] Specifically, the electronic device can perform surface fitting on the third point cloud data based on the least squares method, such as using the RANSAC algorithm to obtain a plane fitting result in the fan-shaped area, and store the remaining point cloud data after removing the external points in data, and initialize the relevant variables Etc., then construct a set of two-variable quadratic equations Z = ax + bxy + cy2 + dx + ey + f, use the calculated statistics to construct a 6x6 coefficient matrix A and a 6-dimensional constant vector B, for the given point cloud data data, traverse each point cloud, calculate and accumulate the required statistics, these statistics include the sum of various powers and products of x, y, z, so as to construct the surface equation.
[0125] Furthermore, the electronic device may solve the surface equation based on Gaussian elimination method, construct the ground model, and extract ground points according to the ground model.
[0126] Specifically, the electronic device can solve the surface equation based on Gaussian elimination method to construct the ground model, such as processing matrix A and vector B through Gaussian elimination method to solve the system of equations, and solving the coefficients a, b, c, d, e, f in the equation array through back substitution after Gaussian elimination method. Finally, for each point, its vertical distance to the fitting surface is calculated, and the final external point filtering is performed to construct the ground model, and the ground points are extracted according to the ground model.
[0127] Therefore, by first fitting locally and then fitting globally, the error can be gradually reduced and the overall fitting accuracy can be improved. Local fitting can help identify and remove outliers and noise, while global fitting can use the remaining point cloud data to optimize the surface model.
[0128] Figure 5 It is a flow chart of another multi-dimensional gradient ground point extraction method provided in an embodiment of the present disclosure.
[0129] like Figure 5 As shown, the electronic device can first calculate the slope tangent value based on the three-dimensional coordinates (x, y, z) of each point in the point cloud data, and perform slope filtering through a set slope threshold (inclination_tangent), and retain the point cloud corresponding to the slope tangent value less than the slope threshold, to obtain the first point cloud data, and return the number of filtered points.
[0130] Next, the first point cloud data is gridded based on the spatial coordinate system to obtain multiple grids, and minimum height point cloud filtering is performed on the multiple point clouds of each grid, such as traversing and calculating the grid indexes to which all point clouds belong, and determining the minimum vertical coordinate of each grid. For the multiple point clouds of each grid, the point clouds whose vertical coordinates are no more than a preset difference value from the minimum vertical coordinate are retained to obtain the second point cloud data.
[0131] Then, the second point cloud data is converted from the spatial coordinate system to the polar coordinate system, and the second point cloud data is divided into fan-shaped areas based on the polar coordinate system to obtain a corresponding plurality of fan-shaped areas, and a plane fitting is performed on the minimum point cloud sample selected in each fan-shaped area based on a random sampling consensus algorithm to obtain a plane model, and the error between the remaining point cloud and the plane model is calculated to determine the outer point cloud and the inner point cloud, and the target plane model is determined based on the number of the inner point cloud, and the corresponding third point cloud data is determined based on the target plane model.
[0132] Finally, surface fitting (binary quadratic surface fitting) is performed on the third point cloud data based on the least squares method to obtain a surface equation, the surface equation is solved based on the Gaussian elimination method, the ground model is constructed, and ground points are extracted based on the ground model.
[0133] Figure 6 is a schematic diagram of the structure of a multi-dimensional gradient ground point extraction device provided by an embodiment of the present disclosure. The multi-dimensional gradient ground point extraction device can be understood as the above-mentioned vehicle or a part of the functional modules in the above-mentioned vehicle. Figure 6 As shown, the multi-dimensional gradient ground point extraction device 600 includes:
[0134] The first processing module 610 is used to perform slope filtering processing on the point cloud data to be processed to obtain filtered first point cloud data.
[0135] The second processing module 620 is used to perform a high degree of filtering on the first point cloud data to obtain filtered second point cloud data.
[0136] The third processing module 630 is used to divide the second point cloud data into sector-shaped areas, and perform external point filtering processing on each sector-shaped area to obtain third point cloud data.
[0137] The data extraction module 640 is used to construct a ground model based on the third point cloud data and extract ground points according to the ground model.
[0138] In an example, the first processing module 610 may specifically include:
[0139] The first processing unit is used to calculate the slope in the spatial coordinate system based on the three-dimensional coordinates of each point cloud in the point cloud data to be processed, so as to obtain the slope tangent value corresponding to each point cloud.
[0140] The first filtering unit is used to retain the point cloud corresponding to the slope tangent value being less than the slope threshold to obtain the first point cloud data.
[0141] In an example, the first processing module 610 may specifically include:
[0142] The point cloud judgment unit is used to judge whether the horizontal coordinate and the vertical coordinate of the point cloud corresponding to the point cloud whose slope tangent value is less than the slope threshold are less than the minimum horizontal coordinate and the minimum vertical coordinate, or greater than the maximum horizontal coordinate and the maximum vertical coordinate.
[0143] The first updating unit is configured to update the minimum horizontal coordinate and the minimum vertical coordinate if the horizontal coordinate and the vertical coordinate of the point cloud are smaller than the minimum horizontal coordinate and the minimum vertical coordinate.
[0144] The second updating unit is configured to update the maximum horizontal coordinate and the maximum vertical coordinate if the horizontal coordinate and the vertical coordinate of the point cloud are greater than the maximum horizontal coordinate and the maximum vertical coordinate.
[0145] In an example, the second processing module 620 may specifically include:
[0146] The second processing unit is used to grid the first point cloud data based on a spatial coordinate system to obtain a plurality of grids.
[0147] The second filtering unit is used to perform minimum height point cloud filtering on multiple point clouds of each grid to obtain the second point cloud data.
[0148] In an example, the second processing module 620 may specifically include:
[0149] The third processing unit is used to traverse and calculate the grid indexes to which all point clouds belong, and determine the minimum vertical coordinate of each grid.
[0150] The third filtering unit is used to retain, for each grid's multiple point clouds, point clouds corresponding to which the vertical coordinates do not exceed a preset difference value with the minimum vertical coordinate to obtain the second point cloud data.
[0151] In an example, the third processing module 630 may specifically include:
[0152] A coordinate conversion unit is used to convert the second point cloud data from a spatial coordinate system into a polar coordinate system.
[0153] A region division unit is used to divide the second point cloud data into sector regions based on the polar coordinate system to obtain a corresponding plurality of sector regions.
[0154] In an example, the third processing module 630 may specifically include:
[0155] The fourth processing unit is used to perform plane fitting on the minimum point cloud sample selected in each sector area based on a random sampling consensus algorithm to obtain a plane model.
[0156] The fifth processing unit is used to calculate the error between the remaining point cloud and the plane model, and determine the outer point cloud and the inner point cloud.
[0157] The sixth processing unit is used to determine the target plane model based on the number of the inner point cloud, and determine the corresponding third point cloud data based on the target plane model.
[0158] In one example, the data extraction module 640 may specifically include:
[0159] The seventh processing unit is used to perform surface fitting on the third point cloud data based on the least squares method to obtain a surface equation.
[0160] The eighth processing unit is used to solve the surface equation based on Gaussian elimination method, construct the ground model, and extract ground points according to the ground model.
[0161] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0162] The embodiments of the present disclosure further provide a vehicle, which includes: a memory, in which a computer program is stored; and a processor, which is used to execute the computer program. When the computer program is executed by the processor, the method of any of the above embodiments can be implemented.
[0163] For example, Figure 7 Schematic diagram of a vehicle structure in the embodiment of the present disclosure. Figure 7 , which shows a schematic diagram of a structure of a vehicle 1000 suitable for implementing the embodiment of the present disclosure. The vehicle 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The vehicle shown is merely an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.
[0164] like Figure 7 As shown, the vehicle 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the vehicle 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0165] Typically, the following devices may be connected to the I / O interface 1005: input devices 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1008 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the vehicle 1000 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The vehicle 1000 is shown with various devices, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0166] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0167] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0168] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperTextTransferProtocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or future developed network.
[0169] The computer-readable medium may be included in the vehicle, or may exist independently without being installed in the vehicle.
[0170] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the vehicle, the vehicle: calculates the average power consumption corresponding to the vehicle's most recent target distance; receives the regional benchmark power consumption and the upper and lower floating range sent by the cloud within a pre-defined area; calculates the estimated dynamic energy consumption based on the average power consumption and the regional benchmark power consumption, and calculates the estimated mileage based on the remaining available power and the estimated dynamic energy consumption, and the estimated dynamic energy consumption is in line with the upper and lower floating range; updates the displayed endurance value based on the estimated mileage.
[0171] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0172] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0173] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0174] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0175] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0176] The embodiments of the present disclosure also provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0177] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any 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.
[0178] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-dimensional gradient ground point extraction method, characterized in that: include: Perform slope filtering on the point cloud data to be processed to obtain filtered first point cloud data; Performing a high degree of filtering on the first point cloud data to obtain filtered second point cloud data; Dividing the second point cloud data into sector-shaped areas, and performing external point filtering processing on each sector-shaped area to obtain third point cloud data; A ground model is constructed based on the third point cloud data, and ground points are extracted according to the ground model.
2. The method according to claim 1, characterized in that The step of performing slope filtering on the point cloud data to be processed to obtain filtered first point cloud data comprises: In the spatial coordinate system, the slope is calculated based on the three-dimensional coordinates of each point cloud in the point cloud data to be processed, and the slope tangent value corresponding to each point cloud is obtained; The point cloud corresponding to the slope tangent value being less than the slope threshold is retained to obtain the first point cloud data.
3. The method according to claim 2, characterized in that The method further comprises: For the point cloud whose slope tangent value is less than the slope threshold, determine whether the abscissa and ordinate of the point cloud are less than the minimum abscissa and the minimum ordinate, or greater than the maximum abscissa and the maximum ordinate; If the abscissa and the ordinate of the point cloud are less than the minimum abscissa and the minimum ordinate, updating the minimum abscissa and the minimum ordinate; If the horizontal coordinate and the vertical coordinate of the point cloud are greater than the maximum horizontal coordinate and the maximum vertical coordinate, the maximum horizontal coordinate and the maximum vertical coordinate are updated.
4. The method according to claim 1, characterized in that: The step of performing a high degree of filtering on the first point cloud data to obtain filtered second point cloud data comprises: Gridding the first point cloud data based on a spatial coordinate system to obtain a plurality of grids; Minimum height point cloud filtering is performed on multiple point clouds of each grid to obtain the second point cloud data.
5. The method according to claim 4, characterized in that The step of filtering the multiple point clouds of each grid by the minimum height point cloud to obtain the second point cloud data includes: Traverse and calculate the grid indexes to which all point clouds belong, and determine the minimum vertical coordinate of each grid; For the multiple point clouds of each grid, the point clouds corresponding to the vertical coordinates not exceeding the preset difference value with the minimum vertical coordinate are retained to obtain the second point cloud data.
6. The method according to claim 1, characterized in that The dividing the second point cloud data into sector-shaped areas comprises: Converting the second point cloud data from a spatial coordinate system into a polar coordinate system; The second point cloud data is divided into sector-shaped areas based on the polar coordinate system to obtain a corresponding plurality of sector-shaped areas.
7. The method according to claim 1, characterized in that Perform external point filtering on each sector area to obtain the third point cloud data, including: Based on the random sampling consensus algorithm, plane fitting is performed on the minimum point cloud sample selected in each sector area to obtain a plane model; Calculating the error between the remaining point cloud and the plane model to determine the outer point cloud and the inner point cloud; A target plane model is determined based on the number of the inner point clouds, and corresponding third point cloud data is determined based on the target plane model.
8. The method according to claim 1, characterized in that The step of constructing a ground model based on the third point cloud data and extracting ground points according to the ground model includes: Performing surface fitting on the third point cloud data based on the least squares method to obtain a surface equation; The surface equation is solved based on Gaussian elimination method, the ground model is constructed, and ground points are extracted according to the ground model.
9. A multi-dimensional gradient ground point extraction device, characterized in that: The device comprises: A first processing module is used to perform slope filtering on the point cloud data to be processed to obtain filtered first point cloud data; A second processing module, used for performing a high degree of filtering on the first point cloud data to obtain filtered second point cloud data; a third processing module, configured to divide the second point cloud data into sector-shaped areas, and perform external point filtering processing on each sector-shaped area to obtain third point cloud data; A data extraction module is used to construct a ground model based on the third point cloud data and extract ground points according to the ground model.
10. A vehicle, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 8.