Point cloud filtering method and device, electronic equipment and storage medium
By dividing the point cloud into multiple voxels and calculating the external occlusion ball center, and retaining part of the voxels according to the preset sampling rate, the problem of reducing the point cloud sampling rate in the prior art affecting the geometric structure is solved, and an efficient and real-time point cloud filtering effect is achieved.
Patent Information
- Application Number
- CN202411807939.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-02
AI Technical Summary
When the prior art processes large-scale point cloud data, reducing the point cloud sampling rate will affect the point cloud geometric structure, and the calculation volume is large and the processing efficiency is low, making it difficult to meet the real-time and practical needs.
By dividing the point cloud into multiple voxels using an octree structure, the center of mass of each voxel is calculated and the external catching ball is calculated, the points other than the center of the external catching ball are filtered, and some voxels are retained according to the preset sampling rate until the target sampling rate is reached.
The geometric structure of the point cloud is effectively kept unaffected, the calculation amount is reduced, the processing efficiency is improved, and the real-time and practical needs can be met.
Smart Images

Figure CN119919295A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a point cloud filtering method, device, electronic device and storage medium. Background Art
[0002] In the field of computer vision technology, point cloud processing technology, as a key technology, is increasingly receiving widespread attention. Point cloud is a collection of a large number of three-dimensional coordinate points, which represent the surface position of an object and are widely used in data preprocessing, segmentation, registration, surface reconstruction, shape recognition and other aspects. Among them, filtering algorithm, as an important part of data preprocessing, plays a key role in removing noise and redundant information in point cloud data and improving data quality. With the continuous development of technology, point cloud processing technology has shown broad application prospects in the fields of autonomous driving, virtual reality, augmented reality and so on.
[0003] However, when processing large-scale point cloud data, existing filtering algorithms often affect the intrinsic geometric structure of the point cloud while reducing the sampling rate of the point cloud, thereby affecting the processing effects of various algorithms such as subsequent segmentation, registration, surface reconstruction, and shape recognition. In addition, when processing large-scale point cloud data, existing filtering algorithms have a large amount of calculation and low processing efficiency, making it difficult to meet the requirements of real-time and practicality.
[0004] Therefore, there is an urgent need for a point cloud filtering method that can reduce the point cloud sampling rate while effectively keeping the intrinsic geometric structure of the point cloud intact, with small computational complexity and high processing efficiency. Summary of the invention
[0005] The embodiments of the present invention provide a point cloud filtering method to solve the problem that the existing technology cannot keep the intrinsic geometric structure of the point cloud intact, has a large amount of calculation, low processing efficiency, and is difficult to meet the real-time and practical requirements. The technical solution is as follows:
[0006] According to one aspect of the present invention, a point cloud filtering method includes: acquiring point cloud data, dividing the point cloud into multiple voxels using an octree structure according to a coordinate range of the point cloud and a preset voxel side length; calculating the center of mass of each point in each voxel, using the center of mass as the center of the sphere and the length of the voxel diagonal as the diameter to obtain multiple circumscribed spheres, and filtering out points other than the center of each circumscribed sphere; for each voxel, using the coordinates of the center of the circumscribed sphere as eigenvalues, calculating the distance between each eigenvalue, and retaining some voxels according to a preset sampling rate and the distance; adding the coordinates and eigenvalues of the retained part of the voxels to the point cloud data, and deleting another part of the voxels from the point cloud data until the target sampling rate is reached, to obtain filtered point cloud data.
[0007] In one of the embodiments, the point cloud is divided into a plurality of voxels using an octree structure according to the coordinate range of the point cloud and a preset voxel side length by the following steps: the maximum value and the minimum value on the three coordinate axes of X, Y, and Z are obtained by traversing each point in the point cloud, and the side length of the minimum bounding box is calculated by subtracting the minimum value from the maximum value on the three coordinate axes; the side length of the voxel grid is set, and the side length of the minimum bounding box is divided by the side length of the voxel grid and rounded down to obtain the size of the voxel grid; the index of each point in the point cloud in the voxel grid is calculated according to the coordinates of each point in the point cloud, the side length of the voxel grid, and the minimum value on the three coordinate axes of X, Y, and Z to obtain a plurality of voxels.
[0008] In one embodiment, the minimum value (X, Y, Z) of the three coordinate axes of the voxel grid is calculated based on the coordinates (x, y, z) of each point in the point cloud, the side length r of the voxel grid, and the minimum value (X min , Y min , Z min ) calculates the index (h) of each point (x, y, z) in the point cloud within the voxel grid x ,h y ,h z ) formula:
[0009]
[0010] In one embodiment, the calculating to obtain the index of each point in the point cloud within the voxel grid further comprises the following steps:
[0011] According to the size of the voxel grid (D x ,D y ,D z ) and the index within the voxel grid (h x ,h y ,h z ) calculates the index h in the voxel grid, and the formula is as follows:
[0012] h=h z ×D x ×D y +h y ×D x +h x .
[0013] In one of the embodiments, the feature value of the voxel is used to represent the position and geometric features of the voxel in the point cloud.
[0014] In one embodiment, retaining part of the voxels according to the preset sampling rate and the distance is achieved by the following steps: setting the sampling rate, determining a distance threshold according to the sampling rate, and retaining the voxels if the distance is less than the distance threshold.
[0015] In one of the embodiments, after obtaining the filtered point cloud data, the method further includes the following steps: using the filtered point cloud data to perform point cloud segmentation and registration processing, performing surface reconstruction processing based on the processed point cloud data to convert the point cloud into a smooth surface, and performing shape recognition processing on the surface to classify the point cloud into different shape categories.
[0016] According to one aspect of the present invention, a point cloud filtering device comprises: a point cloud voxelization module, which is used to obtain point cloud data, and use an octree structure to divide the point cloud into multiple voxels according to the coordinate range of the point cloud and the preset voxel side length; a sphere center filtering module, which is used to calculate the center of mass of each point in each voxel, and calculate multiple circumscribed spheres with the center of mass as the center of the sphere and the length of the voxel diagonal as the diameter, and filter out points other than the center of each circumscribed sphere; a voxel filtering module, which is used to use the coordinates of the center of the circumscribed sphere as eigenvalues for each voxel, calculate the distance between each eigenvalue, and retain some voxels according to the preset sampling rate and the distance; a point cloud filtering module, which is used to add the coordinates and eigenvalues of the retained part of the voxels to the point cloud data, and delete another part of the voxels from the point cloud data until the target sampling rate is reached, so as to obtain filtered point cloud data.
[0017] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements a point cloud filtering method as described above.
[0018] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement a point cloud filtering method as described above.
[0019] The beneficial effects brought by the technical solution provided by the present invention are:
[0020] In the above technical scheme, the present invention first obtains point cloud data, divides the point cloud into multiple voxels according to the coordinate range of the point cloud and the preset voxel side length using an octree structure, calculates the centroid of each point in each voxel, calculates multiple circumscribed spheres with the centroid as the sphere center and the voxel diagonal length as the diameter, filters out points other than the sphere center in each circumscribed sphere, takes the coordinates of the sphere center of the circumscribed sphere as eigenvalues for each voxel, calculates the distance between the eigenvalues, retains some voxels according to the preset sampling rate and distance, adds the coordinates and eigenvalues of the retained part of the voxels to the point cloud data, and deletes another part of the voxels from the point cloud data until the target sampling rate is reached. The point cloud data after filtering is obtained, and the processing efficiency is greatly improved through voxel division. The calculation of the center of the circumscribed sphere of each voxel for center filtering and point cloud filtering not only simplifies the data processing process, but also effectively maintains the intrinsic geometric structure of the point cloud, avoiding the loss of details caused by the traditional filtering method when the sampling rate is reduced. The distance between the center of the circumscribed sphere of the voxel is compared according to the preset sampling rate, and accurate filtering voxel selection is achieved, ensuring the accuracy of the point cloud data after filtering, thereby effectively solving the problem in the existing technology that the intrinsic geometric structure of the point cloud cannot be maintained unaffected, the calculation amount is large, the processing efficiency is low, and it is difficult to meet the real-time and practical requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a point cloud filtering method according to an exemplary embodiment;
[0023] Figure 2 is a flow chart of a point cloud filtering method shown in an exemplary embodiment;
[0024] Figure 3 yes Figure 2 Comparison diagram of the results of the present invention and the prior art in the corresponding embodiments;
[0025] Figure 4 is a block diagram of a point cloud filtering device according to an exemplary embodiment;
[0026] Figure 5 is a hardware structure diagram of an electronic device according to an exemplary embodiment;
[0027] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0028] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0029] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0030] To this end, the present invention provides a point cloud filtering method, which greatly improves the processing efficiency through voxel division. Calculating the center of the circumscribed sphere of each voxel as the eigenvalue not only simplifies the data processing process, but also effectively maintains the intrinsic geometric structure of the point cloud, avoiding the loss of details caused by the traditional filtering method when the sampling rate is reduced. The point cloud filtering method is suitable for a point cloud filtering device, which can be an electronic device. A point cloud filtering method in an embodiment of the present invention can be applied to a variety of scenarios, such as point cloud preprocessing.
[0031] See also Figure 1 , an embodiment of the present invention provides a point cloud filtering method, which is applicable to electronic equipment.
[0032] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.
[0033] like Figure 1 As shown, the method may include the following steps:
[0034] Step 110 , obtaining point cloud data, and using an octree structure to divide the point cloud into a plurality of voxels according to a coordinate range of the point cloud and a preset voxel side length.
[0035] In one possible implementation, each point in the point cloud is traversed to obtain the maximum and minimum values on the three coordinate axes of X, Y, and Z, the maximum value on the three coordinate axes is subtracted from the minimum value to calculate the side length of the minimum bounding box, the side length of the voxel grid is set, the side length of the minimum bounding box is divided by the side length of the voxel grid and rounded down to obtain the size of the voxel grid, and the index of each point in the point cloud in the voxel grid is calculated according to the coordinates of each point in the point cloud, the side length of the voxel grid and the minimum value on the three coordinate axes of X, Y, and Z to obtain a plurality of voxels.
[0036] In one possible implementation, based on the coordinates (x, y, z) of each point in the point cloud, the side length r of the voxel grid, and the minimum value (X) on the three coordinate axes of X, Y, and Z, min , Y min , Z min ) calculates the index (h) of each point (x, y, z) in the point cloud within the voxel grid x ,h y ,h z ) formula:
[0037]
[0038] In one possible implementation, the size of the voxel grid (D x ,D y ,D z ) and the index within the voxel grid (h x ,h y ,h z ) calculates the index h within the voxel grid, and the formula is as follows:
[0039] h=h z ×D x ×D y +h y ×D x +h x .
[0040] Step 130, calculate the centroid of all points inside each voxel, and calculate the center of a circumscribed sphere with the centroid as the center of the circle and the length of the voxel diagonal as the radius, and use the coordinates of the center of the circumscribed sphere as the eigenvalue of the voxel.
[0041] The eigenvalue of the voxel is used to represent the position and geometric characteristics of the voxel in the point cloud.
[0042] Step 150, calculate the centroid of each point in each voxel, calculate multiple circumscribed spheres with the centroid as the sphere center and the length of the voxel diagonal as the diameter, and filter out points other than the sphere center in each circumscribed sphere.
[0043] In a possible implementation, a sampling rate is set, a distance threshold is determined according to the sampling rate, and the distance between the center of the circumscribed sphere of each voxel and the center of the circumscribed sphere of other voxels is calculated. If the distance is less than the distance threshold, the voxel is retained.
[0044] Step 170: For each voxel, the coordinates of the center of the circumscribed sphere are used as eigenvalues, the distances between the eigenvalues are calculated, and some voxels are retained according to a preset sampling rate and distance.
[0045] In one possible implementation, after obtaining the filtered point cloud data, point cloud segmentation and registration processing is performed using the filtered point cloud data, surface reconstruction processing is performed based on the processed point cloud data to convert the point cloud into a smooth surface, and shape recognition processing is performed on the surface to classify the point cloud into different shape categories.
[0046] Through the above process, the embodiment of the present invention first obtains point cloud data, uses an octree structure to divide the point cloud into multiple voxels according to the coordinate range of the point cloud and the preset voxel side length, calculates the center of mass of each point in each voxel, calculates multiple circumscribed spheres with the center of mass as the center of the sphere and the length of the voxel diagonal as the diameter, filters out points other than the center of each circumscribed sphere, and for each voxel, uses the coordinates of the center of the circumscribed sphere as the eigenvalue, calculates the distance between the eigenvalues, retains some voxels according to the preset sampling rate and distance, adds the coordinates and eigenvalues of the retained part of the voxels to the point cloud data, and deletes another part of the voxels from the point cloud data until the target sampling rate is reached. , the filtered point cloud data is obtained, and the processing efficiency is greatly improved through voxel division. The calculation of the center of the circumscribed sphere of each voxel for center filtering and point cloud filtering not only simplifies the data processing process, but also effectively maintains the intrinsic geometric structure of the point cloud, avoiding the loss of details caused by the traditional filtering method when the sampling rate is reduced. The distance between the center of the voxel circumscribed sphere is compared according to the preset sampling rate, and accurate filtering voxel selection is achieved, ensuring the accuracy of the point cloud data after filtering, thereby effectively solving the problem that the inherent geometric structure of the point cloud cannot be maintained unaffected in the existing technology, and the calculation amount is large, the processing efficiency is low, and it is difficult to meet the real-time and practical requirements.
[0047] In an exemplary embodiment, a point cloud filtering method is provided.
[0048] like Figure 2 As shown, the following steps may be specifically included:
[0049] Step S1, voxelization of point cloud.
[0050] Specifically, point cloud data consists of a large number of three-dimensional points, representing the surface shape of an object. In the point cloud voxelization step, the point cloud data is divided into multiple small three-dimensional voxels, each voxel represents a part of the space in the point cloud data. The purpose of this step is to organize the point cloud data into a form that is easier to process.
[0051] Specifically, a large-scale point cloud dataset is divided into several voxels, each voxel represents a part of the space in the point cloud, and an octree structure is used to organize the point cloud data. The point cloud is divided into multiple leaf nodes, each leaf node represents a voxel, and the size of the voxel can be set to a fixed value. The side length of the voxel grid is set to r = 0.1, for example 0.1 meter × 0.1 meter × 0.1 meter.
[0052] Furthermore, the minimum and maximum values X on each coordinate axis are first extracted from the point cloud data. min ,X max ,Y min ,Y max ,Z min ,Z max , these values can be found by traversing all the points in the point cloud, then setting the side length r of the voxel grid and calculating the side length l of the minimum bounding box x ,l y ,l z The formula is as follows:
[0053] ·l x =X max -X min
[0054] ·l y =Y max -Y min
[0055] ·l z =Z max -Z min ;
[0056] Furthermore, the size D of the voxel grid is calculated x ,D y ,D z , the size of the voxel grid can be calculated by dividing the length of each dimension by the side length of the voxel and then rounding down, as follows:
[0057]
[0058] Where, represents rounding down.
[0059] Furthermore, the index h of each point in the point cloud in the voxel grid is calculated. For each point (x, y, z), its index h in the voxel grid can be calculated as follows:
[0060]
[0061] Furthermore, the total index h can be calculated by combining these three indices into a single value, usually in a row-first manner, as follows:
[0062] h=h z ×D x ×D y +h y ×D x +h x ;
[0063] In the above process, the embodiment of the present invention maps each point to a specific position of the voxel grid, thereby achieving voxelization of the point cloud.
[0064] Step S2, calculating the center of the sphere circumscribing the voxel.
[0065] Specifically, after the point cloud is voxelized, the center of the circumscribed sphere is calculated for each voxel. The center of the circumscribed sphere is calculated to further simplify the voxel data while retaining its important geometric features.
[0066] Specifically, the coordinates of the center of the circumscribed sphere can be used as the eigenvalue of the voxel, indicating the position and geometric features of the voxel in the point cloud. All points in the voxel are traversed, the center of mass of these points is calculated, and then the center of multiple circumscribed spheres is calculated with the center of mass as the center of the sphere and the length of the voxel diagonal as the diameter, and the center of the circumscribed sphere is used to represent all the points in the circumscribed sphere.
[0067] Step S3, calculating the distance threshold according to the sampling rate.
[0068] Specifically, the sampling rate is set, a distance threshold is determined according to the sampling rate, and the distance between the center of the circumscribed sphere of each voxel and the center of the circumscribed sphere of other voxels is calculated.
[0069] Step S4: sphere center filtering.
[0070] Specifically, voxels are selectively retained or discarded according to a preset sampling rate or other criteria, and the distances between the centers of the circumscribed spheres of the voxels are compared to determine which voxels should be retained, so as to achieve downsampling or filtering of the point cloud.
[0071] Specifically, for each voxel, the distance between the center of its circumscribed sphere and the center of the circumscribed sphere of other voxels is compared, and whether to retain the voxel is determined based on the size of the distance. If the distance is less than a preset threshold, the voxel is retained; otherwise, the voxel is deleted. In this embodiment, the preset sampling rate is 50%, that is, half of the voxels are retained.
[0072] Step S5: voxel filtering.
[0073] Specifically, after the sphere center filtering, the retained voxels and their related information (such as position, color, etc.) are added to the updated point cloud.
[0074] Specifically, for the retained voxels, their coordinates and eigenvalues are added to the updated point cloud; for the deleted voxels, their coordinates and eigenvalues are deleted from the point cloud.
[0075] Step S6, looping steps S4 and S5 to perform point cloud filtering.
[0076] Through loop filtering, the expected filtering effect or sampling rate can be gradually achieved. Through continuous iteration, the point cloud data is gradually optimized to achieve the expected filtering effect.
[0077] Specifically, steps S4 and S5 are repeated until the sampling rate of the point cloud reaches a preset target value. In this embodiment, the preset target value threshold is 10%, and 10% of the voxels are finally retained.
[0078] Step S7, applying the filtered point cloud.
[0079] Specifically, after multiple cycles of filtering, point cloud data processed by spherical center filtering is finally obtained. These data can be used for subsequent segmentation processing, registration, surface reconstruction, shape recognition and other applications.
[0080] Specifically, the center-of-sphere filtering is applied to various algorithms such as point cloud segmentation, registration, surface reconstruction, and shape recognition to improve the processing speed and effect of the algorithms. Using the point cloud data after the center-of-sphere filtering, point cloud segmentation is performed to divide the point cloud into several independent clusters; then registration is performed to align the relative positions of different point clouds; then surface reconstruction is performed to convert the point cloud into a smooth surface; finally, shape recognition is performed to classify the point cloud into different shape categories.
[0081] like Figure 3 As shown, a comparison diagram of the results of the embodiment of the present invention and the prior art is shown. Among them, Figure (a) shows the original point cloud, Figure (b) shows the point cloud after filtering by the embodiment of the present invention, and Figure (c) shows the point cloud after filtering by the prior art. It can be clearly seen that the point cloud details after the embodiment of the present invention are more fully preserved, while the point cloud arrow details of the prior art are seriously lost.
[0082] Specifically, a point cloud is composed of a large number of three-dimensional coordinate points, which are densely distributed in space and represent the surface position of an object. Figure (a) contains various shapes and details, such as arrows and curved surfaces, for comparison of subsequent filtering effects. Figure (b) shows the point cloud data processed by an improved voxel filtering algorithm based on the center of the circumscribed sphere of the point cloud voxels. Compared with the original point cloud, the number of point clouds after filtering is significantly reduced, but the geometric structure and shape features of the point cloud are effectively preserved, especially the details such as arrows, which are still clearly visible after filtering without obvious shape distortion or detail loss. Figure (c) shows the point cloud data processed by the filtering algorithm of the prior art. Compared with the original point cloud, the number of point clouds after filtering is also reduced, but the details (such as arrows) show obvious shape distortion and detail loss, which indicates that the filtering algorithm of the prior art will destroy the geometric structure and shape features of the point cloud when processing large-scale point cloud data.
[0083] As shown in Table 1 below, the data comparison after filtering in the embodiment of the present invention and after traditional voxel filtering in the prior art is shown. The above results show that the point cloud filtering proposed in the present invention can effectively keep the inherent geometric structure of the point cloud intact while reducing the point cloud sampling rate, and has a small amount of calculation and high processing efficiency.
[0084] Table 5: Filtering results of the embodiments of the present invention and the prior art
[0085]
[0086] Among them, after filtering and in terms of detail preservation of the original data, the sphere center filtering of the embodiment of the present invention retains details very well, while the traditional voxel filtering algorithm has a relatively large detail loss. It can be seen that the sphere center filtering of the embodiment of the present invention can effectively reduce the sampling rate of the point cloud while keeping the intrinsic geometric structure of the point cloud unaffected. This method has the advantages of low computational complexity and high processing efficiency when processing large-scale point cloud data, and can be widely used in various application scenarios of point cloud processing.
[0087] Through the above process, the embodiment of the present invention greatly improves the processing efficiency through voxel division. Calculating the circumscribed sphere center of each voxel as the characteristic value not only simplifies the data processing process, but also effectively maintains the intrinsic geometric structure of the point cloud, avoids the loss of details caused by the traditional filtering method when the sampling rate is reduced, and compares the distance between the circumscribed sphere centers of the voxels according to the preset sampling rate, so as to achieve accurate filtering voxel selection, ensure the accuracy of the point cloud data after filtering, and effectively maintain the intrinsic geometric structure of the point cloud while reducing the sampling rate of the point cloud. By dividing the point cloud into several sphere centers and then performing statistical processing on each sphere center, noise and redundant information are removed. Compared with the existing voxel filtering method, this method has a small amount of calculation and a high processing efficiency. This is of great practical significance for processing large-scale point cloud data. It is particularly practical in improving the processing speed of various algorithms such as registration, surface reconstruction, and shape recognition. This has significant advantages over the prior art. It performs well in processing large-scale point cloud data, so in application scenarios where large-scale point cloud data needs to be processed, such as autonomous driving, virtual reality, augmented reality and other fields, the application prospects of the present invention are broad.
[0088] The following is an embodiment of the device of the present invention, which can be used to perform a point cloud filtering method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of a point cloud filtering method involved in the present invention.
[0089] See also Figure 4 , a point cloud filtering device 800 is provided in an embodiment of the present invention.
[0090] The device 800 includes but is not limited to: a point cloud voxelization module 810 , a sphere center filtering module 830 , a voxel filtering module 850 and a point cloud filtering module 870 .
[0091] The point cloud voxelization module 810 is used to obtain point cloud data and divide the point cloud into multiple voxels using an octree structure according to the coordinate range of the point cloud and a preset voxel side length.
[0092] The voxel filtering module 830 is used to calculate the centroid of each point in each voxel, calculate multiple circumscribed spheres with the centroid as the sphere center and the voxel diagonal length as the diameter, and filter out points other than the sphere center in each circumscribed sphere.
[0093] The spherical center filtering module 850 is used to use the coordinates of the circumscribed sphere center as eigenvalues for each voxel, calculate the distance between each eigenvalue, and retain some voxels according to a preset sampling rate and distance.
[0094] The point cloud filtering module 870 is used to add the coordinates and feature values of some of the retained voxels to the point cloud data, and delete another part of the voxels from the point cloud data until the target sampling rate is reached, so as to obtain filtered point cloud data.
[0095] It should be noted that the point cloud filtering provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the point cloud filtering device will be divided into different functional modules to complete all or part of the functions described above.
[0096] In addition, the point cloud filtering device provided in the above embodiment and an embodiment of a point cloud filtering method belong to the same concept, and the specific manner in which each module performs operations has been described in detail in the method embodiment and will not be repeated here.
[0097] Figure 5 The present invention schematically illustrates the structure of an electronic device according to an exemplary embodiment.
[0098] It should be noted that the electronic device is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The electronic device cannot be interpreted as requiring dependence on or having Figure 5 One or more components of exemplary electronic device 2000 are shown.
[0099] The hardware structure of the electronic device 2000 may vary greatly due to differences in configuration or performance, such as Figure 5 As shown, the electronic device 2000 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .
[0100] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000 .
[0101] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted by the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Figure 5 As shown, this is not intended to be a specific limitation.
[0102] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.
[0103] Among them, the operating system 251 is used to manage and control various hardware devices and application programs 253 on the electronic device 2000 to enable the central processor 270 to calculate and process the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0104] The application program 253 is a computer-readable instruction that performs at least one specific task based on the operating system 251, and may include at least one module ( Figure 5 (not shown), each module may respectively include computer-readable instructions for the electronic device 2000. For example, the point cloud filtering device may be regarded as an application 253 deployed on the electronic device 2000.
[0105] The data 255 may be signal information, etc., stored in the memory 250 .
[0106] The central processor 270 may include one or more processors and is configured to communicate with the memory 250 through at least one communication bus to read computer-readable instructions stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, a point cloud filtering method is completed by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.
[0107] In addition, the present invention can also be implemented by hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present invention is not limited to any specific hardware circuits, software, or a combination of the two.
[0108] See also Figure 6 In an embodiment of the present invention, an electronic device 4000 is provided. The electronic device 400 may include: a desktop computer, a laptop computer, a server, etc. with sensor recognition capability.
[0109] exist Figure 6 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.
[0110] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0111] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception, etc. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0112] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0113] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited to this.
[0114] The memory 4003 stores computer-readable instructions, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .
[0115] The computer-readable instructions are executed by one or more processors 4001 to implement a point cloud filtering method in the above embodiments.
[0116] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement a point cloud filtering method as described above.
[0117] A computer program product is provided in an embodiment of the present invention. The computer program product includes computer-readable instructions. The computer-readable instructions are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements a point cloud filtering method as described above.
[0118] Compared with the related art, the present invention has the following beneficial effects:
[0119] 1. The present invention first obtains point cloud data, divides the point cloud into multiple voxels using an octree structure according to the coordinate range of the point cloud and the preset voxel side length, calculates the centroid of each point in each voxel, calculates multiple circumscribed spheres with the centroid as the sphere center and the voxel diagonal length as the diameter, filters out points other than the sphere center in each circumscribed sphere, takes the coordinates of the sphere center of the circumscribed sphere as the eigenvalue for each voxel, calculates the distance between the eigenvalues, retains some voxels according to the preset sampling rate and distance, adds the coordinates and eigenvalues of the retained part of the voxels to the point cloud data, deletes another part of the voxels from the point cloud data until the target sampling rate is reached, and obtains the filtered voxels. The point cloud data after filtering has greatly improved the processing efficiency through voxel division. Calculating the center of the circumscribed sphere of each voxel for center filtering and point cloud filtering not only simplifies the data processing process, but also effectively maintains the intrinsic geometric structure of the point cloud, avoiding the loss of details caused by the traditional filtering method when the sampling rate is reduced. The distance between the center of the circumscribed sphere of the voxel is compared according to the preset sampling rate, and accurate filtering voxel selection is achieved, ensuring the accuracy of the point cloud data after filtering. This can effectively solve the problem that the existing technology cannot keep the intrinsic geometric structure of the point cloud unaffected, the calculation amount is large, the processing efficiency is low, and it is difficult to meet the real-time and practical requirements.
[0120] 2. The present invention can effectively maintain the geometric structure: while reducing the sampling rate of the point cloud, it can effectively keep the inherent geometric structure of the point cloud intact, thus avoiding the problem of geometric structure destruction that may be caused when reducing the sampling rate in the prior art.
[0121] 3. The present invention can solve the problem of precision loss in industrial scenarios: In some scenarios with relatively high industrial precision requirements, the traditional voxel filtering algorithm suffers from relatively large detail loss, while the center-of-sphere filtering method used in this solution retains details very well and can perfectly solve this problem.
[0122] 4. The present invention can improve processing efficiency: Compared with the existing voxel filtering method, the center-of-sphere filtering method of this scheme has a smaller amount of calculation and a higher processing efficiency, which is of great practical significance for processing large-scale point cloud data.
[0123] 5. The present invention can enhance practicality: Since the present solution can maintain the geometric structure while reducing the point cloud sampling rate, and has a small amount of calculation and high processing efficiency, it is particularly practical in improving the processing speed of various algorithms such as registration, surface reconstruction, and shape recognition.
[0124] 6. The present invention has broad application prospects: Since the present solution performs well in processing large-scale point cloud data, it has broad application prospects in application scenarios that require processing large-scale point cloud data, such as autonomous driving, virtual reality, augmented reality and other fields.
[0125] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0126] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A point cloud filtering method, characterized in that: The method comprises: Acquire point cloud data, and divide the point cloud into a plurality of voxels using an octree structure according to a coordinate range of the point cloud and a preset voxel side length; Calculate the centroid of each point in each voxel, calculate multiple circumscribed spheres with the centroid as the sphere center and the diagonal length of the voxel as the diameter, and filter out points other than the sphere center in each circumscribed sphere; For each of the voxels, the coordinates of the center of the circumscribed sphere are used as eigenvalues, the distances between the eigenvalues are calculated, and some of the voxels are retained and other voxels are deleted according to a preset sampling rate and the distances; The coordinates and characteristic values of the reserved part of the voxels are added to the point cloud data, and another part of the voxels are deleted from the point cloud data until the target sampling rate is reached, so as to obtain the filtered point cloud data.
2. A point cloud filtering method as claimed in claim 1, characterized in that: The using of the octree structure to divide the point cloud into a plurality of voxels according to the coordinate range of the point cloud and a preset voxel side length includes: By traversing each point in the point cloud, the maximum value and the minimum value on the three coordinate axes of X, Y, and Z are obtained, and the side length of the minimum bounding box is calculated by subtracting the minimum value from the maximum value on the three coordinate axes; Setting the side length of the voxel grid, dividing the side length of the minimum bounding box by the side length of the voxel grid and rounding down to obtain the size of the voxel grid; The index of each point in the point cloud in the voxel grid is calculated according to the coordinates of each point in the point cloud, the side length of the voxel grid and the minimum value on the three coordinate axes of X, Y and Z to obtain a plurality of voxels.
3. A point cloud filtering method as claimed in claim 2, characterized in that: The method is based on the coordinates (x, y, z) of each point in the point cloud, the side length r of the voxel grid and the minimum value (X) on the three coordinate axes of X, Y and Z. min , Y min , Z min ) calculates the index (h) of each point (x, y, z) in the point cloud within the voxel grid x ,h y ,h z ) formula:
4. A point cloud filtering method as claimed in claim 3, characterized in that: The calculating to obtain the index of each point in the point cloud within the voxel grid also includes: According to the size of the voxel grid (D x ,D y ,D z ) and the index within the voxel grid (h x ,h y ,h z ) calculates the index h in the voxel grid, and the formula is as follows: h=h z ×D x ×D y +h y ×D x +h x 。 5. A point cloud filtering method as claimed in claim 1, characterized in that: The feature value of the voxel is used to represent the position and geometric features of the voxel in the point cloud.
6. A point cloud filtering method according to claim 1, characterized in that: The retaining part of the voxels according to the preset sampling rate and the distance comprises: A sampling rate is set, a distance threshold is determined according to the sampling rate, and the voxel is retained if the distance is less than the distance threshold.
7. A point cloud filtering method according to claim 1, characterized in that: After obtaining the filtered point cloud data, the method further includes: The filtered point cloud data is used to perform point cloud segmentation and registration processing, a surface reconstruction processing is performed on the processed point cloud data to convert the point cloud into a smooth surface, and a shape recognition processing is performed on the surface to classify the point cloud into different shape categories.
8. A point cloud filtering device, characterized in that: The device comprises: A point cloud voxelization module, used for acquiring point cloud data, and using an octree structure to divide the point cloud into a plurality of voxels according to a coordinate range of the point cloud and a preset voxel side length; A spherical center filtering module is used to calculate the centroid of each point in each voxel, calculate multiple circumscribed spheres with the centroid as the sphere center and the diagonal length of the voxel as the diameter, and filter out points other than the sphere center in each circumscribed sphere; A voxel filtering module, for each voxel, using the coordinates of the center of the circumscribed sphere as a characteristic value, calculating the distance between the characteristic values, and retaining some voxels according to a preset sampling rate and the distance; The point cloud filtering module is used to add the coordinates and characteristic values of the reserved part of the voxels to the point cloud data, and delete another part of the voxels from the point cloud data until the target sampling rate is reached, so as to obtain the filtered point cloud data.
9. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements a point cloud filtering method as described in any one of claims 1 to 7.
10. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement a point cloud filtering method according to any one of claims 1 to 7.
Citation Information
Cited By
Object pose estimation method and device based on three-dimensional point cloud and storage medium
CN121616661A