Three-dimensional point cloud bottom surface segmentation method, device, electronic device and storage medium
By filtering and meshing the three-dimensional point cloud, points that meet the preset conditions are extracted to determine the bottom surface, solving the problem of low accuracy of bottom surface segmentation in the traditional method and achieving higher segmentation accuracy.
Patent Information
- Application Number
- CN202211566698.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-12-07
AI Technical Summary
The bottom segmentation method of traditional three-dimensional point clouds is relatively accurate, especially when the bottom surface is uneven, which can easily lead to incomplete extraction or excessive extraction.
By obtaining the three-dimensional point cloud in the target space, filtering and meshing are performed, points that meet the preset conditions are extracted based on the three-dimensional coordinates of the points in the mesh, the bottom surface of the three-dimensional point cloud is determined, and segmented.
The accuracy of the three-dimensional point cloud bottom segmentation is improved, and the bottom surface can be accurately extracted in the case of unevenness of the bottom surface, avoiding incomplete extraction or excessive extraction.
Smart Images

Figure CN116385702B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of laser radar technology, and in particular to a method, device, electronic device and storage medium for bottom surface segmentation of a three-dimensional point cloud. Background Art
[0002] With the continuous development of LiDAR technology, 3D point clouds have been widely used in many fields, such as smart cities, autonomous driving, etc. The bottom surface segmentation of 3D point clouds is an important part of 3D point cloud data processing. The accuracy of the result has a great impact on the calculation accuracy of the bounding box and plane fitting of subsequent 3D point cloud data.
[0003] However, the traditional bottom surface segmentation method of three-dimensional point clouds is to extract and segment using the coordinate range, that is, using the distance judgment criterion of the Euclidean distance clustering method, for a certain point P in space, the KD-Tree nearest neighbor search algorithm is used to find the k points closest to point p. Among these points, those with a distance less than the set threshold are clustered into the set Q. If the number of elements in Q does not increase, the entire clustering process ends; otherwise, other points other than point p must be selected in the set Q, and the above process is repeated until the number of elements in the set Q does not increase. Therefore, the accuracy of the segmentation result is low when the traditional bottom surface segmentation method of three-dimensional point clouds is used, especially when the bottom surface is uneven, which will lead to incomplete or over-extraction of the bottom surface, resulting in a large deviation between the segmentation result and the actual result.
[0004] Therefore, how to effectively segment the bottom surface of three-dimensional points has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a method, device, electronic device and storage medium for bottom surface segmentation of a three-dimensional point cloud to solve the problem of low accuracy of segmentation results when using a traditional bottom surface segmentation method of a three-dimensional point cloud.
[0006] In a first aspect, an embodiment of the present application provides a method for bottom surface segmentation of a three-dimensional point cloud, the method comprising:
[0007] Obtain the three-dimensional point cloud corresponding to the target space;
[0008] Performing filtering processing on the three-dimensional point cloud;
[0009] The filtered three-dimensional point cloud is meshed to obtain a mesh set;
[0010] According to the three-dimensional coordinates of the points in each grid in the grid set in the preset coordinate system, all points in each grid that meet the preset conditions are extracted, and the bottom surface of the three-dimensional point cloud is determined according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and a preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system;
[0011] The bottom surface of the three-dimensional point cloud is segmented.
[0012] Optionally, the filtering-processed three-dimensional point cloud is meshed to obtain a mesh set, including:
[0013] Obtain the coordinate distribution range of the filtered three-dimensional point cloud in two directions perpendicular to the target direction;
[0014] According to the coordinate distribution range in two directions perpendicular to the target direction and the pre-set grid granularity in the two directions perpendicular to the target direction, the three-dimensional point cloud after filtering is gridded to obtain a grid set of the three-dimensional point cloud in the target direction, wherein the target direction is any direction of multiple directions of a preset coordinate system, and the grid granularity is used to characterize the number of grids that need to be divided into the three-dimensional point cloud in the corresponding direction.
[0015] Optionally, the obtaining of the coordinate distribution range of the three-dimensional point cloud after filtering in two directions perpendicular to the target direction includes:
[0016] Obtain the maximum coordinate value and the minimum coordinate value of each point in the three-dimensional point cloud after filtering in two directions perpendicular to the target direction;
[0017] According to the obtained maximum coordinate value and minimum coordinate value, the coordinate distribution range in two directions perpendicular to the target direction is determined.
[0018] Optionally, the three-dimensional point cloud after filtering is meshed according to the coordinate distribution range in two directions perpendicular to the target direction and the mesh granularity pre-set in the two directions perpendicular to the target direction to obtain a mesh set of the three-dimensional point cloud in the target direction, including:
[0019] Obtain the pre-set grid granularity in two directions perpendicular to the target direction;
[0020] The three-dimensional point cloud after filtering is meshed according to a preset meshing rule to obtain a mesh set of the three-dimensional point cloud in the target direction, wherein the preset meshing rule is to equally divide the coordinate distribution range in two directions perpendicular to the target direction according to their respective corresponding mesh granularities.
[0021] Optionally, extracting all points in each grid that meet a preset condition according to the three-dimensional coordinates of points in each grid in the grid set, and determining the bottom surface of the three-dimensional point cloud according to the extracted points includes:
[0022] Determining the minimum coordinate value of the points in each grid in the grid set in the target direction according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system;
[0023] Extracting all points that meet the preset conditions in each grid respectively, and using all the extracted points as the bottom surface corresponding to each grid;
[0024] The bottom surfaces corresponding to the grids are merged to obtain the bottom surface of the three-dimensional point cloud.
[0025] Optionally, the filtering the three-dimensional point cloud includes:
[0026] Using a minimum radius method to obtain a marking result of each point in the three-dimensional point cloud;
[0027] According to the marking result, filtering processing is performed on the three-dimensional point cloud.
[0028] Optionally, the formula for obtaining the marking result is as follows:
[0029]
[0030] Wherein, Num(R) represents the number of points in a spherical area with the target point as the center and R as the radius, N std is a preset threshold, flag represents the marking result of the target point, and the target point is any point in the three-dimensional point cloud.
[0031] In a second aspect, an embodiment of the present application further provides a bottom surface segmentation device for a three-dimensional point cloud, the device comprising:
[0032] An acquisition module is used to obtain the three-dimensional point cloud corresponding to the target space;
[0033] A filtering processing module, used for performing filtering processing on the three-dimensional point cloud;
[0034] A meshing module is used to mesh the filtered three-dimensional point cloud to obtain a mesh set;
[0035] A determination module, configured to extract all points in each grid that meet preset conditions according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system, and determine the bottom surface of the three-dimensional point cloud according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and a preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system;
[0036] The segmentation module is used to segment the bottom surface of the three-dimensional point cloud.
[0037] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0038] Memory, used to store computer programs;
[0039] The processor is used to implement the steps of the bottom surface segmentation method of the three-dimensional point cloud described in any embodiment of the first aspect when executing the program stored in the memory.
[0040] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the bottom surface segmentation method of a three-dimensional point cloud as described in any embodiment of the first aspect.
[0041] In an embodiment of the present application, a three-dimensional point cloud corresponding to a target space is obtained; the three-dimensional point cloud is filtered; the three-dimensional point cloud after filtering is meshed to obtain a grid set; all points in each grid that meet a preset condition are extracted according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system, and the bottom surface of the three-dimensional point cloud is determined according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and the preset bottom surface thickness threshold, and the target direction is any direction in which multiple coordinate axes of the preset coordinate system are located; the bottom surface of the three-dimensional point cloud is segmented. In the above manner, points that meet the preset conditions in each grid in the grid set can be extracted with the grid as a unit, that is, all points in each grid whose coordinate value in the target direction is greater than or equal to the bottom surface thickness threshold than the minimum coordinate value in the target direction can be extracted, so as to accurately obtain the bottom surface corresponding to each grid, thereby determining the bottom surface of the three-dimensional point cloud. In this way, even when the bottom surface of the three-dimensional point cloud is uneven, the bottom surfaces at different positions can be accurately extracted based on the minimum coordinate value in the target direction corresponding to the grids at different positions and the bottom surface thickness threshold, avoiding incomplete or over-extraction of the bottom surface of the three-dimensional point cloud, thereby improving the accuracy of the bottom surface segmentation of the three-dimensional point cloud. 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 invention and, together with the description, serve to explain the principles of the invention.
[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 A schematic diagram of a flow chart of a bottom surface segmentation method of a three-dimensional point cloud provided in an embodiment of the present application;
[0045] Figure 2 A schematic diagram of a laser radar scanning provided in an embodiment of the present application;
[0046] Figure 3 A detailed flowchart of the steps of meshing a filtered three-dimensional point cloud to obtain a mesh set provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of a grid set Gx divided in the X direction provided in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of a grid set Gy divided in the Y direction provided in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of a grid set Gz divided in the Z direction provided in an embodiment of the present application;
[0050] Figure 7 A detailed flowchart of the steps of extracting all points that meet preset conditions in each grid according to the three-dimensional coordinates of points in each grid in the grid set, and determining the bottom surface of the three-dimensional point cloud according to the extracted points provided in the embodiment of the present application;
[0051] Figure 8 A schematic diagram of the structure of a bottom surface segmentation device for a three-dimensional point cloud provided in an embodiment of the present application;
[0052] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 without making creative work are within the scope of protection of this application.
[0054] Embodiment 1
[0055] See also Figure 1 , Figure 1 The following is a flow chart of a method for bottom surface segmentation of a three-dimensional point cloud provided in an embodiment of the present application. Figure 1 As shown, the bottom surface segmentation method of the three-dimensional point cloud may specifically include the following steps:
[0056] Step 101: Obtain the three-dimensional point cloud corresponding to the target space.
[0057] Specifically, the target space may be any three-dimensional space, and the embodiments of the present application do not make any specific limitation thereto.
[0058] The method of obtaining the three-dimensional point cloud corresponding to the target space can be achieved through laser radar. Figure 2As shown in the figure, the three-dimensional point cloud can be obtained by scanning the buildings and the ground in a certain area through the laser radar. Since the two buildings are located at the low ground and the high ground respectively, when segmenting the two buildings, it is necessary to first extract the point cloud corresponding to the segmented ground, and then segment the point clouds of the two buildings, so as to improve the accuracy of the three-dimensional point cloud segmentation.
[0059] Step 102: Filter the three-dimensional point cloud.
[0060] In this step, the three-dimensional point cloud can be filtered by methods such as through filtering, statistical filtering, radius filtering, improved bilateral filtering, voxel grid filtering, etc., so as to filter out outliers in the three-dimensional point cloud and retain valid points to improve the accuracy of data processing.
[0061] Step 103: mesh the filtered three-dimensional point cloud to obtain a mesh set.
[0062] In this step, the filtered 3D point cloud can be divided according to one or more directions according to actual needs to obtain one or more grid sets consisting of multiple grids, so as to facilitate the subsequent bottom surface extraction based on each grid in each grid set, thereby obtaining the bottom surface of the entire 3D point cloud. Figure 2 In the target space shown, the ground is the bottom surface to be acquired. Since the ground has high ground and low ground, they are not on the same horizontal plane. Figure 2 When extracting and segmenting the point cloud corresponding to the ground shown in the figure, it is necessary to mesh the plane where the ground is located to obtain multiple rectangular meshes for subsequent processing operations. Of course, when the target space is other three-dimensional space, such as a room or a vehicle, the three-dimensional point cloud of the target space may have multiple bottom surfaces. At this time, it is necessary to mesh the three-dimensional point cloud of the target space in multiple directions to achieve extraction and segmentation of multiple bottom surfaces.
[0063] Step 104, based on the three-dimensional coordinates of the points in each grid in the grid set in the preset coordinate system, extract all points in each grid that meet the preset conditions, and determine the bottom surface of the three-dimensional point cloud based on the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and a preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system.
[0064] Specifically, the above-mentioned preset condition refers to a condition set according to the minimum coordinate value in a certain direction in the preset coordinate system and the preset bottom surface thickness threshold. If a point in a certain grid meets the preset condition, it means that the point can be used as a point in the bottom surface; if a point in a certain grid does not meet the preset condition, it means that the point cannot be used as a point in the bottom surface. In this way, all points that meet the preset conditions in each grid can be extracted according to the three-dimensional coordinates of the points in each grid in the grid set, and the bottom surface of the three-dimensional point cloud can be determined according to the extracted points.
[0065] Step 105: Segment the bottom surface of the three-dimensional point cloud.
[0066] After determining the bottom surface of the 3D point cloud, the bottom surface of the 3D point cloud can be segmented for subsequent data processing.
[0067] In this implementation, points that meet preset conditions in each grid in the grid set can be extracted with the grid as a unit, that is, all points in each grid whose coordinate value in the target direction is greater than or equal to the bottom surface thickness threshold value than the minimum coordinate value in the target direction can be extracted, so as to accurately obtain the bottom surface corresponding to each grid, thereby determining the bottom surface of the three-dimensional point cloud. In this way, even if the bottom surface of the three-dimensional point cloud is uneven, the bottom surface at different positions can be accurately extracted based on the minimum coordinate value in the target direction corresponding to the grids at different positions and the bottom surface thickness threshold, avoiding incomplete extraction or over-extraction of the bottom surface of the three-dimensional point cloud, thereby improving the accuracy of the bottom surface segmentation of the three-dimensional point cloud.
[0068] Embodiment 2
[0069] In one embodiment, the filtered three-dimensional point cloud can be meshed to obtain a mesh set, so as to facilitate the subsequent extraction of the bottom surface of each mesh to obtain the bottom surface of the three-dimensional point cloud. Figure 3 , Figure 3 A detailed flowchart of the steps of meshing the filtered three-dimensional point cloud to obtain a mesh set is provided in an embodiment of the present application. Figure 3 As shown, the above step 103, meshing the filtered three-dimensional point cloud to obtain a mesh set, may specifically include:
[0070] Step 301: Obtain the coordinate distribution range of the filtered three-dimensional point cloud in two directions perpendicular to the target direction.
[0071] In this step, when it is necessary to divide the three-dimensional point cloud according to the target direction, it is first necessary to obtain the coordinate distribution range of the three-dimensional point cloud after filtering in the two directions perpendicular to the target direction, that is, the minimum distribution point and the maximum distribution point of the three-dimensional point cloud in the two directions perpendicular to the target direction. Specifically, the above step 301, obtaining the coordinate distribution range of the three-dimensional point cloud after filtering in the two directions perpendicular to the target direction, may include:
[0072] Obtain the maximum coordinate value and the minimum coordinate value of each point in the three-dimensional point cloud after filtering in two directions perpendicular to the target direction;
[0073] According to the obtained maximum coordinate value and minimum coordinate value, the coordinate distribution range in two directions perpendicular to the target direction is determined.
[0074] In this way, the three-dimensional coordinates of each point in the three-dimensional point cloud after filtering can be sorted according to the three different directions of X, Y, and Z in the preset coordinate system, and the maximum coordinate value and the minimum coordinate value in each direction can be determined, thereby obtaining the maximum coordinate value in the X direction, recorded as Xmax; the minimum coordinate value in the X direction, recorded as Xmin; the maximum coordinate value in the Y direction, recorded as Ymax; the minimum coordinate value in the Y direction, recorded as Ymin; the maximum coordinate value in the Z direction, recorded as Zmax; the minimum coordinate value in the Z direction, recorded as Zmin. Therefore, when obtaining the coordinate distribution range of the three-dimensional point cloud after filtering in two directions perpendicular to the target direction, the maximum coordinate value and the minimum coordinate value of each point in the three-dimensional point cloud after filtering in two directions perpendicular to the target direction can be obtained first, and then the coordinate distribution range in the two directions perpendicular to the target direction can be determined according to the obtained maximum coordinate value and minimum coordinate value. In this way, the three-dimensional point cloud after filtering can be accurately meshed according to the target direction to improve the accuracy of meshing.
[0075] Step 302: According to the coordinate distribution range in two directions perpendicular to the target direction and the pre-set grid granularity in the two directions perpendicular to the target direction, the three-dimensional point cloud after filtering is meshed to obtain a grid set of the three-dimensional point cloud in the target direction, wherein the target direction is any direction in multiple directions of a preset coordinate system, and the grid granularity is used to characterize the number of grids that need to be divided in the corresponding direction of the three-dimensional point cloud.
[0076] It should be noted that the grid granularity in different directions can be the same or different, and can be set according to actual needs, and the embodiments of this application do not make specific limitations. The larger the grid granularity, the more grids need to be divided, and the higher the accuracy of the bottom surface extraction; the smaller the grid granularity, the fewer grids need to be divided, and the lower the accuracy of the bottom surface extraction.
[0077] Specifically, the above step 302, according to the coordinate distribution range in two directions perpendicular to the target direction and the pre-set grid granularity in the two directions perpendicular to the target direction, meshes the three-dimensional point cloud after filtering to obtain a grid set of the three-dimensional point cloud in the target direction, including:
[0078] Obtain the pre-set grid granularity in two directions perpendicular to the target direction;
[0079] The three-dimensional point cloud after filtering is meshed according to a preset meshing rule to obtain a mesh set of the three-dimensional point cloud in the target direction, wherein the preset meshing rule is to equally divide the coordinate distribution range in two directions perpendicular to the target direction according to their respective corresponding mesh granularities.
[0080] In this way, the pre-set grid granularity in the two directions perpendicular to the target direction can be obtained first, and then the coordinate distribution ranges in the two directions perpendicular to the target direction can be equally divided according to the corresponding grid granularity, so as to realize the grid division of the three-dimensional point cloud after filtering and obtain the grid set of the three-dimensional point cloud in the target direction. For example, assuming that the X direction in the preset coordinate system is used as the target direction, the coordinate distribution ranges in the Y and Z directions perpendicular to the X direction are (Ymax-Ymin) and (Zmax-Zmin) respectively, and the grid granularity in the Y and Z directions is M1, then the grid can be divided according to each grid length (Xmax-Xmin), width (Ymax-Ymin) / M1, and height (Zmax-Zmin) / M1, and a total of M1*M1 grid sets Gx in the X direction can be obtained, such as Figure 4 shown.
[0081] Assuming that the Y direction in the preset coordinate system is taken as the target direction, the coordinate distribution ranges in the X and Z directions perpendicular to the Y direction are (Xmax-Xmin) and (Zmax-Zmin) respectively, and the grid granularity in the X and Z directions is M2, then the grid can be divided according to each grid length of (Xmax-Xmin) / M2, width of (Ymax-Ymin), and height of (Zmax-Zmin) / M2, and a total grid set Gy of M2*M2 in the Y direction is obtained, as shown in Figure 5 shown.
[0082] Assuming that the Z direction in the preset coordinate system is taken as the target direction, the coordinate distribution ranges in the X and Y directions perpendicular to the Z direction are (Xmax-Xmin) and (Ymax-Ymin) respectively, and the grid granularity in the X and Y directions is M3, the grid can be divided according to each grid length of (Xmax-Xmin) / M3, width of (Ymax-Ymin) / M3, and height of (Zmax-Zmin), and a total grid set Gz of M3*M3 in the Z direction is obtained, as shown in Figure 6 shown.
[0083] It should be noted that M1, M2 and M3 here are the grid granularity in the three directions of X, Y and Z respectively. The smaller the value, the lower the accuracy, and the larger the value, the higher the accuracy. As an optional implementation, the value range of M1, M2 and M3 is generally 10-20.
[0084] In this implementation, the grid granularity can be flexibly set according to actual conditions to obtain different numbers of grids; and grid division can be performed on multiple different directions of the three-dimensional point cloud to obtain grid sets in multiple different directions, which facilitates the extraction and segmentation of the bottom surface of the three-dimensional point cloud in multiple different directions.
[0085] Embodiment 3
[0086] In one embodiment, all points in each grid that meet preset conditions can be extracted based on the three-dimensional coordinates of the points in each grid in the grid set, and the bottom surface of the three-dimensional point cloud can be determined based on the extracted points, so as to facilitate the subsequent segmentation of the bottom surface of the three-dimensional point cloud. Figure 7 , Figure 7 A detailed flowchart of the steps of extracting all points that meet preset conditions in each grid according to the three-dimensional coordinates of the points in each grid in the grid set, and determining the bottom surface of the three-dimensional point cloud according to the extracted points is provided in the embodiment of the present application. Figure 7 As shown, the above step 104, extracting all points in each grid that meet the preset conditions according to the three-dimensional coordinates of the points in each grid in the grid set, and determining the bottom surface of the three-dimensional point cloud according to the extracted points, may specifically include:
[0087] Step 701: Determine the minimum coordinate value of the points in each grid in the grid set in a target direction according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system.
[0088] Step 702: extract all points satisfying preset conditions in each grid respectively, and use all extracted points as the bottom surface corresponding to each grid.
[0089] Step 703: merge the bottom surfaces corresponding to the grids to obtain the bottom surface of the three-dimensional point cloud.
[0090] In one embodiment, the minimum coordinate value of the points in each grid in the grid set in the target direction can be obtained first, and then all points in each grid that meet preset conditions are extracted according to the minimum coordinate value as the bottom surface corresponding to each grid, and finally the bottom surfaces corresponding to each grid are merged to obtain the bottom surface of the three-dimensional point cloud.
[0091] For example, for Figure 4 The grid set G shown x A grid G in x (i, j), the minimum coordinate value G of all points in the grid in the X direction can be obtained x (i,j) min , and then the grid in the X direction belongs to [G x (i,j) min , G x (i,j) min +C x ] are extracted as the bottom surface of the grid. According to the above rules, the grid set G is extracted in turn. x The bottom surface of each mesh in the image is then merged to obtain the bottom surface Bx after segmentation in the X direction.
[0092] against Figure 5 The grid set G shown y A grid G in y (i, j), the minimum coordinate value G of all points in the grid in the Y direction can be obtained y (i,j) min , and then the grid in the Y direction belongs to [G y (i,j) min , G y (i,j) min +C y ] are extracted as the bottom surface of the grid. According to the above rules, the grid set G is extracted in turn. y The bottom surface of each mesh in the image is then merged to obtain the bottom surface B after segmentation in the Y direction. y .
[0093] against Figure 6 The grid set G shown z A grid G in z (i, j), the minimum coordinate value G of all points in the grid in the Z direction can be obtained z (i,j) min , and then the mesh in the Z direction belongs to [G z (i,j) min , G z (i,j) min+C z ] are extracted as the bottom surface of the grid. According to the above rules, the grid set G is extracted in turn. z The bottom surface of each mesh in the image is then merged to obtain the bottom surface B after segmentation in the Z direction. z .
[0094] It should be noted that i and j here represent the number of rows and columns of the grid in the grid set, respectively. x , C y and C z represents the bottom thickness threshold in the three directions of X, Y and Z respectively. As an optional implementation, C x , C y and C z The value can be 0.5 to 2 meters.
[0095] In this embodiment, points that meet preset conditions in each grid can be extracted using the grid as a unit, so as to accurately obtain the bottom surface corresponding to each grid, which is used as the bottom surface of the three-dimensional point cloud. In this way, even if the bottom surface of the three-dimensional point cloud is uneven, the bottom surface of the three-dimensional point cloud can be accurately extracted, thereby improving the accuracy of the bottom surface segmentation of the three-dimensional point cloud.
[0096] Embodiment 4
[0097] In one embodiment, before meshing the 3D point cloud, the 3D point cloud may be filtered. Specifically, the above step 102, filtering the 3D point cloud, may include:
[0098] The minimum radius method is used to obtain the marking results of each point in the three-dimensional point cloud;
[0099] According to the marking results, the 3D point cloud is filtered.
[0100] In this way, after obtaining the 3D point cloud corresponding to the target space, the 3D point cloud corresponding to the target space can be filtered. Specifically, the minimum radius method can be used to obtain the marking results of each point in the 3D point cloud, and then the 3D point cloud can be filtered according to the marking results to remove outliers in the 3D point cloud.
[0101] Specifically, the above minimum radius method can be expressed by the following formula:
[0102]
[0103] Among them, Num(R) represents the number of points in the spherical area with the target point as the center and R as the radius, N std is the preset threshold, flag represents the marking result of the target point, and the target point is any point in the three-dimensional point cloud.
[0104] In this way, according to the above formula, the number of points in the spherical area with a radius of R can be calculated, and then the marking result of any point in the three-dimensional point cloud can be determined. If the calculated marking result is 1, the point is retained. If the calculated marking result is 0, the point is discarded to achieve the purpose of filtering out outliers.
[0105] When dividing the grid, since it is necessary to divide according to the maximum and minimum coordinate values in two directions perpendicular to the target direction, if the outliers are not filtered out, the grid division accuracy will be low; at the same time, when extracting the bottom surface of each grid, since it is necessary to extract according to the minimum coordinate value of the points in each grid in the target direction, if the outliers are not filtered out, the bottom surface extraction will be incomplete. Therefore, it is necessary to filter the three-dimensional point cloud to ensure the accuracy of the grid division and bottom surface extraction links of the three-dimensional point cloud, so as to improve the accuracy of the bottom surface segmentation of the three-dimensional point cloud.
[0106] Embodiment 5
[0107] See also Figure 8 , Figure 8 A schematic diagram of the structure of a bottom surface segmentation device for a three-dimensional point cloud provided in an embodiment of the present application. The bottom surface segmentation device 800 for a three-dimensional point cloud may include:
[0108] An acquisition module 801 is used to acquire a three-dimensional point cloud corresponding to the target space;
[0109] A filtering processing module 802 is used to perform filtering processing on the three-dimensional point cloud;
[0110] A meshing module 803 is used to mesh the filtered three-dimensional point cloud to obtain a mesh set;
[0111] The determination module 804 is used to extract all points in each grid that meet preset conditions according to the three-dimensional coordinates of the points in each grid in the grid set in the preset coordinate system, and determine the bottom surface of the three-dimensional point cloud according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and a preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system;
[0112] The segmentation module 805 is used to segment the bottom surface of the three-dimensional point cloud.
[0113] Furthermore, the grid division module 803 includes:
[0114] The first acquisition submodule is used to obtain the coordinate distribution range of the three-dimensional point cloud after filtering in two directions perpendicular to the target direction;
[0115] The grid division submodule is used to grid the three-dimensional point cloud after filtering according to the coordinate distribution range in two directions perpendicular to the target direction and the pre-set grid granularity in the two directions perpendicular to the target direction, so as to obtain a grid set of the three-dimensional point cloud in the target direction, wherein the target direction is any direction in multiple directions of the preset coordinate system, and the grid granularity is used to characterize the number of grids that need to be divided in the corresponding direction of the three-dimensional point cloud.
[0116] Furthermore, the first acquisition submodule includes:
[0117] A first acquisition unit is used to acquire the maximum coordinate value and the minimum coordinate value of each point in the three-dimensional point cloud after filtering in two directions perpendicular to the target direction;
[0118] The determination unit is used to determine the coordinate distribution range in two directions perpendicular to the target direction according to the acquired maximum coordinate value and minimum coordinate value.
[0119] Furthermore, the grid partitioning submodule includes:
[0120] A second acquisition unit is used to acquire the pre-set grid granularity in two directions perpendicular to the target direction;
[0121] A grid division unit is used to grid the filtered three-dimensional point cloud according to a preset grid division rule to obtain a grid set of the three-dimensional point cloud in the target direction, wherein the preset grid division rule is to divide the coordinate distribution range in two directions perpendicular to the target direction into equal parts according to their respective corresponding grid granularities.
[0122] Further, the determination module 804 includes:
[0123] A determination submodule, used to determine the minimum coordinate value of the points in each grid in the grid set in the target direction according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system;
[0124] The extraction submodule is used to extract all points that meet the preset conditions in each grid, and use all the extracted points as the bottom surface corresponding to each grid;
[0125] The merging submodule is used to merge the bottom surfaces corresponding to each grid to obtain the bottom surface of the three-dimensional point cloud.
[0126] Furthermore, the filtering processing module 802 includes:
[0127] The second acquisition submodule is used to obtain the marking result of each point in the three-dimensional point cloud by using the minimum radius method;
[0128] The filtering processing submodule is used to perform filtering processing on the three-dimensional point cloud according to the marking results.
[0129] Furthermore, the formula for obtaining the marking result is as follows:
[0130]
[0131] Among them, Num(R) represents the number of points in the spherical area with the target point as the center and R as the radius, N std is the preset threshold, flag represents the marking result of the target point, and the target point is any point in the three-dimensional point cloud.
[0132] It should be noted that the bottom surface segmentation device 800 of the three-dimensional point cloud can implement the steps of the bottom surface segmentation method of the three-dimensional point cloud provided by any of the aforementioned method embodiments, and can achieve the same technical effect, which will not be described one by one here.
[0133] Embodiment 6
[0134] like Fig. 9 As shown, the embodiment of the present application further provides an electronic device, including a processor 911, a communication interface 912, a memory 913 and a communication bus 914, wherein the processor 911, the communication interface 912, and the memory 913 communicate with each other through the communication bus 914.
[0135] Memory 913, used for storing computer programs;
[0136] In one embodiment of the present application, the processor 911 is used to execute the program stored in the memory 913 to implement the bottom surface segmentation method of the three-dimensional point cloud provided by any one of the above method embodiments, including:
[0137] Obtain the three-dimensional point cloud corresponding to the target space;
[0138] Filter the 3D point cloud;
[0139] The filtered three-dimensional point cloud is meshed to obtain a mesh set;
[0140] According to the three-dimensional coordinates of the points in each grid in the grid set in the preset coordinate system, all points in each grid that meet the preset conditions are extracted, and the bottom surface of the three-dimensional point cloud is determined according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and the preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system;
[0141] Segment the bottom surface of the 3D point cloud.
[0142] Embodiment 7
[0143] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the bottom surface segmentation method of a three-dimensional point cloud provided in any one of the aforementioned method embodiments are implemented.
[0144] 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.
[0145] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. 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 invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for bottom surface segmentation of a three-dimensional point cloud, characterized in that: The method comprises: Obtain the three-dimensional point cloud corresponding to the target space; Performing filtering processing on the three-dimensional point cloud; The filtered three-dimensional point cloud is meshed to obtain a mesh set; According to the three-dimensional coordinates of the points in each grid in the grid set in the preset coordinate system, all points in each grid that meet the preset conditions are extracted, and the bottom surface of the three-dimensional point cloud is determined according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and a preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system; Segmenting the bottom surface of the three-dimensional point cloud; The filtering process on the three-dimensional point cloud includes: Using a minimum radius method to obtain a marking result of each point in the three-dimensional point cloud; According to the marking result, filtering is performed on the three-dimensional point cloud; The formula for obtaining the marking result is as follows: Wherein, Num(R) represents the number of points in a spherical area with the target point as the center and R as the radius, N std is a preset threshold, flag represents the marking result of the target point, and the target point is any point in the three-dimensional point cloud.
2. The method according to claim 1, characterized in that The three-dimensional point cloud after filtering is meshed to obtain a mesh set, including: Obtain the coordinate distribution range of the filtered three-dimensional point cloud in two directions perpendicular to the target direction; According to the coordinate distribution range in two directions perpendicular to the target direction and the pre-set grid granularity in the two directions perpendicular to the target direction, the three-dimensional point cloud after filtering is gridded to obtain a grid set of the three-dimensional point cloud in the target direction, wherein the target direction is any direction of multiple directions of a preset coordinate system, and the grid granularity is used to characterize the number of grids that need to be divided into the three-dimensional point cloud in the corresponding direction.
3. The method according to claim 2, characterized in that The obtaining of the coordinate distribution range of the filtered three-dimensional point cloud in two directions perpendicular to the target direction includes: Obtain the maximum coordinate value and the minimum coordinate value of each point in the three-dimensional point cloud after filtering in two directions perpendicular to the target direction; According to the obtained maximum coordinate value and minimum coordinate value, the coordinate distribution range in two directions perpendicular to the target direction is determined.
4. The method according to claim 2, characterized in that: The method of meshing the filtered three-dimensional point cloud according to the coordinate distribution range in two directions perpendicular to the target direction and the pre-set mesh granularity in the two directions perpendicular to the target direction to obtain a mesh set of the three-dimensional point cloud in the target direction includes: Obtain the pre-set grid granularity in two directions perpendicular to the target direction; The three-dimensional point cloud after filtering is meshed according to a preset meshing rule to obtain a mesh set of the three-dimensional point cloud in the target direction, wherein the preset meshing rule is to equally divide the coordinate distribution range in two directions perpendicular to the target direction according to their respective corresponding mesh granularities.
5. The method according to claim 1, characterized in that The extracting all points in each grid that meet preset conditions according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system, and determining the bottom surface of the three-dimensional point cloud according to the extracted points, includes: Determining the minimum coordinate value of the points in each grid in the grid set in the target direction according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system; Extracting all points that meet the preset conditions in each grid respectively, and using all the extracted points as the bottom surface corresponding to each grid; The bottom surfaces corresponding to the grids are merged to obtain the bottom surface of the three-dimensional point cloud.
6. A bottom surface segmentation device for a three-dimensional point cloud, characterized in that: The device comprises: An acquisition module is used to obtain the three-dimensional point cloud corresponding to the target space; A filtering processing module, used for performing filtering processing on the three-dimensional point cloud; A meshing module is used to mesh the filtered three-dimensional point cloud to obtain a mesh set; A determination module, configured to extract all points in each grid that meet preset conditions according to the three-dimensional coordinates of the points in each grid in the grid set in a preset coordinate system, and determine the bottom surface of the three-dimensional point cloud according to the extracted points, wherein the preset condition is that the value range of the point in the target direction is greater than or equal to the minimum coordinate value in the target direction, and less than or equal to the sum of the minimum coordinate value in the target direction and a preset bottom surface thickness threshold, and the target direction is any direction of the directions of multiple coordinate axes of the preset coordinate system; A segmentation module, used for segmenting the bottom surface of the three-dimensional point cloud; Wherein, the filtering processing module includes: A second acquisition submodule is used to obtain the marking result of each point in the three-dimensional point cloud by using a minimum radius method; A filtering processing submodule, used for performing filtering processing on the three-dimensional point cloud according to the marking result; The formula for obtaining the marking result is as follows: Wherein, Num(R) represents the number of points in a spherical area with the target point as the center and R as the radius, N std is a preset threshold, flag represents the marking result of the target point, and the target point is any point in the three-dimensional point cloud.
7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the bottom surface segmentation method of the three-dimensional point cloud described in any one of claims 1-5 when executing the program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the bottom surface segmentation method of a three-dimensional point cloud described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method and apparatus for ground segmentation based on point cloud data, and computer device
WO2022099511A1