This application claims priority to Chinese Patent Application No. 201410731449.5 filed on Dec. 5, 2014, the contents of which are incorporated by reference herein.
The subject matter herein relates to point cloud technology, and particularly to a computing device and a method for processing point clouds of an object.
A plurality of groups of point clouds of an object scanned by a scanner can be merged to be a new group of point clouds which have a higher precision. The new group of point clouds can be meshed for obtaining a point cloud model. However, there are a lot of redundant points among the plurality of groups of point clouds. If the redundant points are not filtered from the plurality of groups of point clouds, the new group of point clouds cannot be meshed efficiently and precisely.
Many aspects of the disclosure can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. The drawings are not necessarily to scale and the proportions of certain parts can be exaggerated to better illustrate details and features. The description is not to be considered as limiting the scope of the embodiments described herein.
Several definitions that apply throughout this disclosure will now be presented. The term “module” refers to logic embodied in computing or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules can be embedded in firmware, such as in an erasable programmable read only memory (EPROM). The modules described herein can be implemented as either software and/or computing modules and can be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY™, flash memory, and hard disk drives. The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series and the like.
In at least one embodiment, the storage device 12 can store a plurality of point cloud files of an object (e.g., a workpiece) which require to be merged.
The acquisition module 100 acquires a plurality of groups of point clouds of an object from the storage device 12, and selects two groups of point clouds as a first group of point clouds and a second group of point clouds. The acquisition module 100 can acquire the groups of point clouds by reading a plurality of point cloud files, which are stored in the storage device 12 and are required to be merged. The acquisition module 100 can further display the first group of point clouds and the second group of point clouds on the display screen 13.
The first marking module 101 determines redundant points in the first group of point clouds and in the second group of point clouds, and marks each of the redundant points using a first indicator (e.g., a number “0”). In at least one embodiment, the first marking module 101 determines a first bounding box of the first group of point clouds by calculating a minimum X coordinate value and a maximum X coordinate value, a minimum Y coordinate value and a maximum Y coordinate value, and a minimum Z coordinate value and a maximum Z coordinate value from coordinates values of the first group of point clouds based on a predetermined coordinate system. The first marking module 101 further determines a second bounding box of the second group of point clouds by calculating a minimum X coordinate value and a maximum X coordinate value, a minimum Y coordinate value and a maximum Y coordinate value, and a minimum Z coordinate value and a maximum Z coordinate value from coordinates values of the second group of point clouds.
The first marking module 101 further calculates an overlapping area between the first bounding box and the second bounding box. If the overlapping area has no point both in the first group of point clouds and the second group of point clouds, the first marking module 101 determines that there is no redundant points in the first group of point clouds and the second group of point clouds, and the first group of point clouds and the second group of point clouds can be merged to be a new group of point clouds directly. If the overlapping area has one or more points both in the first group of point clouds and the second group of point clouds, the first marking module 101 determines that the one or more points in the overlapping area are the redundant points and marks the redundant points using the first indicator.
The second marking module 102 determines normal points in the second group of point clouds and marks each of the normal points using a second indicator (e.g., with a number “1”). A minimum distance between each of the normal points and points in the first group of point clouds is greater than a preset distance. In at least one embodiment, the second marking module 102 can calculate distances between each point in the second group of point clouds and the points in the first group of point clouds, and determines a minimum distance corresponding to each point in the second group of point clouds. If the minimum distance corresponding to one point is greater than the preset distance, the second marking module 102 determines the point to be the normal point and marks the normal point with the second indicator.
It should be understood that, if one point marked with the first indicator (e.g., one redundant point) in the second group of point clouds is further determined to be the normal point, that is, the determination of the redundant point needs to be corrected, the second marking module 102 uses the second indicator to replace the first indicator for indicating that the point is the normal point, but not the redundant point. In other embodiments, the second marking module 102 can clear the first indicator of the redundant point which is determined to be the normal point, in the second group of point clouds. After the second marking module 102 marks the normal points in the second group of point clouds, the redundant points in the second group of point clouds can be rechecked.
The filtering module 103 uses a plurality of cubes to divide a max bounding box of the redundant points marked with the first indicator in the first and the second groups of point clouds according to a cube segmentation method, and clears a first indicator of a specified redundant point in each of the plurality of cubes which has a minimum distance to a centre point of each of the plurality of cubes. In at least one embodiment, the filtering module 103 extracts a minimum X coordinate value “Xmin” and a maximum X coordinate value “Xmax”, a minimum Y coordinate value “Ymin” and a maximum Y coordinate value “Ymax”, and a minimum Z coordinate value “Zmin” and a maximum Z coordinate value “Zmax” from coordinate values of the redundant points. The filtering module 103 further determines a side length “L” of a minimum bounding cube of the redundant points by an equation of “L=max((Xmax−Xmin), (Ymax−Ymin), (Zmax−Zmin))”. The filtering module 103 confirms a minimum distance “Lmin” between each two points of the redundant points according to an equation of “Lmin≈3√{square root over (L3/n)}”, and “n” represents a number of redundant points. The minimum distance “Lmin” is determined to be a minimum side length of each of the cubes. By dividing the max bounding box of the redundant points using the plurality of cubes having the minimum side length “Lmin”, each cube can include at least one redundant point.
In at least one embodiment, after the filtering module 103 divides the max bounding box of the redundant points using the plurality of cubes having the minimum side length “Lmin”, the filtering module 103 selects one point “V (Xv, Yv, Zv)” from the redundant points as a vertex point, and calculates a centre point O (X0, Y0, Z0) of the corresponding cube which includes the point “V (Xv, Yv, Zv)”. The coordinates of the centre point O (X0, Y0, Z0) can be represented by equations of
According to the above equations, the filtering module 103 can calculate coordinate values of centre points of all of the plurality of cubes. The filtering module 103 further calculates a distance between each redundant point included in each cube and the centre point of the each cube according to a preset distance formula (e.g., an Euler distance formula of “Dis=√{square root over ((Δx)2+(Δy)2+(Δz)2)}”). The filtering module 103 determines a specified redundant point which has the minimum distance to the centre point of the each cube, and clears the first indicator of the specified redundant point. The specified redundant point is regarded to be the normal point, but not the redundant point. In other embodiments, the filtering module 103 can also use the second indicator to replace the first indicator of the specified redundant point in each cube, for indicating that the specified redundant point is not the redundant point.
In at least one embodiment, in order to manage the plurality of cubes, the filtering module 103 creates a linked list “list[M][N][W]” according to numbers of the cubes on an X axis, Y axis and Z axis which are represented by
A structure array can be created according to the linked list and preset index values (e.g., coordinates) of each of the redundant points. For example, members of the structure array can include suffix of each of the redundant points and suffix of a corresponding cube which includes the redundant point. Using the structure array, each cube can be related to one or more redundant points included in the cube.
The merging module 104 merges points which have not been marked with the first indicators in the first group of point clouds and in the second group of point clouds to be a new group of point clouds. In at least one embodiment, the merging module 104 checks the indicators of all of points in the first group of point clouds and in the second group of point clouds, discards the points marked with the first indicator from the first group of point clouds and the second group of point clouds, and inserts the points marked with the second indicator and the points having no indicator in the new group of point clouds. That is, the new group of point clouds includes the points marked with the second indicator or the points having no indicator.
The determination module 105 determines whether all of the plurality of groups of point clouds have been selected. If there is at least one group of point clouds that has not been selected, the acquisition module 100 determines the new group of point clouds as an updated first group of point clouds and determines one unselected group of point clouds as an updated second group of point clouds to be merged, until all of the acquired groups of point clouds of the object have been merged to generate new precise point clouds of the object.
In other embodiment, after the maximum bounding box of the redundant points marked with the first indicator is divided by cubes, not only is the first indicator of the specified redundant point in each cube cleared or replaced by the second indicator which has the minimum distance to the centre point of the each cube, but also the redundant points included in each cube except the specified redundant point are deleted. Therefore, a data merging procedure of the first group of point clouds and the second group of point clouds can be simplified.
Referring to
At block 301, an acquisition module acquires a plurality of groups of point clouds of an object from the storage device 12, and selects two groups of point clouds as a first and second group of point clouds. The acquisition module can acquire the groups of point clouds by reading a plurality of point cloud files, which are stored in the storage device 12 to be merged. The acquisition module can further display the first group of point clouds and the second group of point clouds on the display screen 13.
At block 302, a first marking module determines redundant points in the first group of point clouds and in the second group of point clouds, and marks each of the redundant points using a first indicator (e.g., with a number of “0”). In at least one embodiment, the first marking module 101 determines a first bounding box of the first group of point clouds by calculating a minimum X coordinate value and a maximum X coordinate value, a minimum Y coordinate value and a maximum Y coordinate value, and a minimum Z coordinate value and a maximum Z coordinate value from coordinates values of the first group of point clouds based on a predetermined coordinate system. The first marking module 101 further determines a second bounding box of the second group of point clouds by calculating a minimum X coordinate value and a maximum X coordinate value, a minimum Y coordinate value and a maximum Y coordinate value, and a minimum Z coordinate value and a maximum Z coordinate value from coordinates values of the second group of point clouds.
In at least one embodiment, the first marking module further calculates an overlapping area between the first bounding box and the second bounding box. If the overlapping area has no point in both the first group of point clouds and the second group of point clouds, it represents that there is no redundant points in the first group of point clouds and the second group of point clouds, and the first group of point clouds and the second group of point clouds can be merged to be a new group of point clouds directly, block 306 can be implemented. If the overlapping area has one or more points both in the first group of point clouds and the second group of point clouds, the points in the overlapping area are determined to be redundant points and the first marking module 101 marks each of the redundant points using the first indicator.
At block 303, a second marking module determines normal points in the second group of point clouds, and marks each of the normal points using a second indicator (e.g., with a number of “1”). A minimum distance between each of the normal points and points in the first group of point clouds is greater than a preset distance. In at least one embodiment, the second marking module can calculate distances between each point in the second group of point clouds and the points in the first group of point clouds, and determines a minimum distance corresponding to each point in the second group of point clouds. If the minimum distance corresponding to one point is greater than the preset distance, the second marking module determines the point to be the normal point and the second marking module marks the normal point using the second indicator.
It should be understood that, if one point marked with the first indicator (e.g., one redundant point) in the second group of point clouds is determined to be the normal point, it represents that the determination of the redundant point needs to be corrected, the second marking module 102 uses the second indicator to replace the first indicator for indicating that the point is the normal point, but not the redundant point. In other embodiments, the second marking module 102 can clear the first indicator of the redundant point which is determined to be the normal point in the second group of point clouds. After the second marking module marks the normal points in the second group of point clouds, the redundant points in the second group of point clouds can be rechecked.
At block 304, a filtering module uses a plurality of cubes to divide a max bounding box of the redundant points marked with the first indicator in the first and the second group of point clouds according to a cube segmentation method method, and clears a first indicator of a specified redundant point in each of the plurality of cubes which has a minimum distance to a central point of each of the plurality of cubes. In at least one embodiment, the filtering module extracts a minimum X coordinate value “Xmin” and a maximum X coordinate value “Xmax”, a minimum Y coordinate value “Ymin” and a maximum Y coordinate value “Ymax”, and a minimum Z coordinate value “Zmin” and a maximum Z coordinate value “Zmax” from coordinate values of the redundant points and determines a side length “L” of a minimum bounding cube of the redundant points by an equation of “L=max((Xmax−Xmin), (Ymax−Ymin), (Zmax−Zmin))”. The filtering module 103 confirms a minimum distance “Lmin” between each two redundant points in according to an equation of “Lmin≈3·√{square root over (L3/n)}”, and “n” represents a number of the redundant points. The minimum distance “Lmin” is determined to be a minimum side length of each of the cubes. By dividing the max bounding box of the redundant points using the plurality of cubes having the minimum side length “Lmin”, each cube can include at least one redundant point.
In at least one embodiment, after the filtering module 103 divides the max bounding box of the redundant points using the plurality of cubes having the minimum side length “Lmin”, the filtering module selects a point “V (Xv, Yv, Zv)” from the redundant points as a vertex point, and calculates an centre point O (X0, Y0, Z0) of the corresponding cube which includes the point “V (Xv, Yv, Zv)”. The coordinates of the centre point O (X0, Y0, Z0) can be represented by equations of
According to the above equations, the filtering module can calculate coordinate values of centre points for all of the plurality of cubes. The filtering module further calculates a distance between each point included in each cube and the centre point of the each cube according to a preset distance formula (e.g., an Euler distance formula of “Dis=√{square root over ((Δx)2+(Δy)2+(Δz)2)}”). The filtering module determines a specified redundant point which has the minimum distance from the centre point of the each cube, and clears the first indicator of the specified redundant point. The specified redundant point is regarded as the normal point, but not the redundant point. In other embodiments, the filtering module can also use the second indicator to replace the first indicator of the determined a redundant point with the minimum distance from the centre point of the corresponding cube, for indicating that the specified redundant point is not the redundant point.
At block 305, a merging module merges points which have not been marked with the first indicators in the first group of point clouds and in the second group of point clouds to be a new group of point clouds. In at least one embodiment, the merging module checks the indicators of all of points in the first group of point clouds and in the second group of point clouds, discards the points marked with the first indicator, and inserts the points marked with the second indicator and the points having no indicator in the new group of point clouds.
At block 306, a determination module determines whether all of the plurality of groups of point clouds have been selected. If there is at least one group of point clouds not selected, block 307 is implemented. If all of the acquired groups of point clouds have been selected to be merged, the procedure ends.
At block 307, the acquisition module determines the new group of point clouds as an updated first group of point clouds and continuously selects one unselected group of point clouds as an updated second group of point clouds to be merged, and block 302 is implemented.
All of the processes described above can be embodied in, and fully automated via, functional code modules executed by one or more general purpose processors such as the processor 11. The code modules can be stored in any type of non-transitory readable medium or other storage device such as the storage device 12. Some or all of the methods can alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory readable medium can be a hard disk drive, a compact disc, a digital versatile disc, a tape drive, or other storage medium.
The described embodiments are merely examples of implementations, and have been set forth for a clear understanding of the principles of the present disclosure. Variations and modifications can be made without departing substantially from the spirit and principles of the present disclosure. All such modifications and variations are intended to be included within the scope of this disclosure and the described inventive embodiments, and the present disclosure is protected by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
201410731449.5 | Dec 2014 | CN | national |