This application claims priority to Chinese Patent Application No. 201410774967.5 filed on Dec. 16, 2014, the contents of which are incorporated by reference herein.
The subject matter herein generally relates to point clouds technology, and particularly to a computing device and a method for patching point clouds of an object.
A scanning device can measure a plurality of points to generate point clouds by scanning a surface of an object (e.g., a component of a mobile phone). Voids may occur in places of a point cloud due to an external interference during the scanning of the object or a problem of the scanning device itself occurring during the scan. The voids need to be patched for subsequent use using a filling algorithm. However, because of complicated shapes and different sizes of the voids, the filling algorithm usually cannot make up the missed points of the point cloud at their intended positions and a distortion of the point cloud may be resulted due to the patching.
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 may 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, as shown in
The processing module 11 is configured to acquire a point cloud of an object from the storage device 30, and triangulate the point cloud using a plurality of triangles. In at least one embodiment, the point cloud can be represented by the plurality of triangles after triangulation. In at least one embodiment, the point cloud can be a set of points representing the external surface of the object. The object can be, but is not limited to, a component (e.g., a shell) of an electronic device (e.g., a mobile phone). In at least one embodiment, the point cloud includes data of, but not limited to, three dimensional coordinates of points of the point cloud, identifications of the points and a total number of the points. The point cloud can be obtained from a database in the storage device 30 or a three-dimensional scanner which is scanning the object.
The identification module 12 is configured to identify a void in the point cloud that needs to be patched. In at least one embodiment, the void in the point cloud to be patched can be identified based on a predetermined characteristic of the point cloud. The predetermined characteristic can be, but is not limited to, sides of the void located on a single triangle of the point cloud.
In at least one embodiment, the identification module 12 traverses each side of the plurality of triangles of the point cloud, and confirms sides of the plurality of triangles located on a single triangle of the point cloud. When the confirmed sides of the plurality of triangles generate an enclosed area of the point cloud, the identification module 12 determines that the enclosed area of the point cloud is the void to be patched.
The filling module 13 is configured to obtain one or more triangles to patch the void according to one or more included angles of neighboring sides of the void of the point cloud, and fill the void of the point cloud with the one or more obtained triangles.
In at least one embodiment, the filling module 13 can define a first predetermined value and a second predetermined value for obtaining the one or more triangles to patch the void, and determine a plurality of intervals according to the first and second predetermined values. The first predetermined value (e.g., 90°) is less than the second predetermined value (e.g.,) 180°. The first predetermined value and the second predetermined value are preset by a user or by the point cloud patch system 10. Three intervals are determined by the first and second predetermined values, and the three intervals can be a first interval, a second interval, and a third interval. The first interval is less than or equal to the first predetermined value, the second interval is greater than the first predetermined value and is less than or equal to the second predetermined value, and the third interval is greater than the second predetermined value. In addition, three or more predetermined values (e.g., four predetermined values) are available for obtaining the one or more triangles to patch the void.
In at least one embodiment, the filling module 13 further calculates an included angle of two neighboring sides of the void, and determines an interval the included angle of the two neighboring sides of the void belongs to. In at least one embodiment, when the included angle of the two neighboring sides of the void is in the first interval, two vertices of the neighboring sides of the void on different sides are joined to obtain a triangle for patching the void by the filling module 13. As an example shown in
In at least one embodiment, when the included angle of the two neighboring sides of the void is in the second interval, the filling module 13 constructs a bi-section of the included angle of the two neighboring sides of the void, and joins the endpoint of the bi-section with two vertices of the neighboring sides of the void on different sides separately to obtain two triangles for patching the void. The endpoint of the bi-section is a point that does not overlap with the vertex of the included angle of the two neighboring sides of the void. The length of the bi-section is an average of the length of the two neighboring sides of the void. As an example shown in
In at least one embodiment, when the included angle of the two neighboring sides of the void is in the third interval, the filling module 13 keeps the two neighboring sides of the void unchanged. That is, the filling module 13 does nothing with the two neighboring sides of the void, and no triangles are obtained for patching the void. As an example shown in
In at least one embodiment, the filling module 13 continuously determines the included angles of neighboring sides of the void, and obtains triangles for patching the void until a single triangle is left on three sides of the void.
The adjusting module 14 is configured to adjust the filled triangles according to normal vectors of the filled triangles to keep the filled triangles in accordance with surrounding triangles in shape features. In at least one embodiment, the filled triangles which are obtained when the included angle of the two neighboring sides of the void is in the first interval do not need to be adjusted. The filled triangles which are obtained when the included angle of the two neighboring sides of the void is in the second interval need to be adjusted by the adjusting module 14.
In at least one embodiment, the adjusting module 14 obtains the bi-section of the included angle of the two neighboring sides of the void, calculates a normal vector of the starting point of the bi-section. The starting point of the bi-section is a point that overlaps with the vertex of the included angle of the two neighboring sides of the void. The normal vector of the starting point “vi” of the bi-section “vivnew” shown in
and a covariance matrix of “Si” is represented as “C=[vj1−
In at least one embodiment, the adjusting module 14 further calculates normal vectors of the two triangles related to the bi-section. The two triangles related to the bi-section are the two triangles obtained by joining the endpoint of the bi-section with two vertices of the neighboring sides of the void on different sides separately. As the example shown in
In at least one embodiment, the adjusting module 14 obtains an angle to be rotated by the bi-section according to the normal vector of the starting point of the bi-section and the normal vectors of the two triangles related to the bi-section, and obtains two adjusted triangles according to the rotated angle of the bi-section. In at least one embodiment, when the rotated angle of the bi-section is greater than zero, the bi-section is rotated upward to an absolute value of the rotated angle of the bi-section corresponding to the plane of the two triangles related to the bi-section by the adjusting module 14. When the rotated angle of the bi-section is less than zero, the bi-section is rotated downward to the absolute value of the rotated angle of the bi-section corresponding to the plane of the two triangles related to the bi-section by the adjusting module 14. When the rotated angle of the bi-section is equal to zero, the bi-section is kept unchanged by the adjusting module 14. The adjusting module 14 obtains two adjusted triangles by joining the endpoint of the adjusted bi-section with the two vertices of the two neighboring sides of the void on different sides separately. The endpoint of the adjusted bi-section is a point that does not overlap with the vertex of the included angle of the two neighboring sides of the void.
As an example shown in
The smoothing module 15 is configured to smooth the patched point cloud, and output the patched point cloud to be displayed on the display screen 40. In at least one embodiment, the smoothing module 15 uses a preset smoothing method to smooth the patched point cloud. In at least one embodiment, the preset smoothing method can be, but is not limited to, moving along the directions of normal vectors of filled points in the void until the filled points satisfy a required accuracy of smoothness. The required accuracy of smoothness can be set up by the user or the point cloud patch system 10. The filled points in the void are endpoints of adjusted bi-sections in the void.
Referring to
At block 310, a processing module acquires a point cloud of an object from a storage device of the computing device, and triangulates the point cloud using a plurality of triangles. In at least one embodiment, the point cloud can be represented by the plurality of triangles after triangulation. In at least one embodiment, the point cloud can be a set of points representing the external surface of the object. The object can be, but is not limited to, a component (e.g., a shell) of an electronic device (e.g., a mobile phone). In at least one embodiment, the point cloud includes data of, but not limited to, three dimensional coordinates of points of the point cloud, identifications of the points and a total number of the points. The point cloud can be obtained from a database in the storage device or a three-dimensional scanner which is scanning the object.
At block 320, an identification module identifies a void in the point cloud that needs to be patched. In at least one embodiment, the void in the point cloud to be patched can be identified based on a predetermined characteristic of the point cloud. The predetermined characteristic can be, but is not limited to, sides of the void located on a single triangle of the point cloud.
In at least one embodiment, the identification module traverses each side of the plurality of triangles of the point cloud, and confirms sides of the plurality of triangles located on a single triangle of the point cloud. When the confirmed sides of the plurality of triangles generate an enclosed area of the point cloud, the identification module determines the enclosed area of the point cloud as the void to be patched.
At block 330, a filling module obtains one or more triangles to patch the void according to one or more included angles of neighboring sides of the void of the point cloud, and fills the void of the point cloud with the one or more obtained triangles.
In at least one embodiment, the filling module can define a first predetermined value and a second predetermined value for obtaining the one or more triangles to patch the void, and determine a plurality of intervals according to the first and second predetermined values. The first predetermined value (e.g., 90°) is less than the second predetermined value (e.g., 180°). The first predetermined value and the second predetermined value are preset by a user or by a point cloud patch system of the computing device. Three intervals are determined by the first and second predetermined values, and the three intervals can be a first interval, a second interval, and a third interval. The first interval is less than or equal to the first predetermined value, the second interval is greater than the first predetermined value and is less than or equal to the second predetermined value, and the third interval is greater than the second predetermined value. In addition, three or more predetermined values (e.g., four predetermined values) are available for obtaining the one or more triangles to patch the void.
In at least one embodiment, the filling module further calculates an included angle of two neighboring sides of the void, and determines an interval the included angle of the two neighboring sides of the void belongs to. In at least one embodiment, when the included angle of the two neighboring sides of the void is in the first interval, two vertices of the neighboring sides of the void on different sides are joined to obtain a triangle for patching the void by the filling module. In at least one embodiment, when the included angle of the two neighboring sides of the void is in the second interval, the filling module constructs a bi-section of the included angle of the two neighboring sides of the void, and joins the endpoint of the bi-section with two vertices of the neighboring sides of the void on different sides separately to obtain two triangles for patching the void. The endpoint of the bi-section is a point that does not overlap with the vertex of the included angle of the two neighboring sides of the void. The length of the bi-section is an average of the length of the two neighboring sides of the void. In at least one embodiment, when the included angle of the two neighboring sides of the void is in the third interval, the filling module keeps the two neighboring sides of the void unchanged. That is, the filling module does nothing with the two neighboring sides of the void, and no triangles are obtained for patching the void. In at least one embodiment, the filling module continuously determines the included angles of neighboring sides of the void, and obtains triangles for patching the void until a single triangle is left on three sides of the void.
At block 340, an adjusting module adjusts the filled triangles according to normal vectors of the filled triangles to keep the filled triangles in accordance with surrounding triangles in shape features. In at least one embodiment, the filled triangles which are obtained when the included angle of the two neighboring sides of the void is in the first interval do not need to be adjusted. The filled triangles which are obtained when the included angle of the two neighboring sides of the void is in the second interval need to be adjusted by the adjusting module.
In at least one embodiment, the adjusting module obtains the bi-section of the included angle of the two neighboring sides of the void, calculates a normal vector of the starting point of the bi-section. The starting point of the bi-section is a point that overlaps with the vertex of the included angle of the two neighboring sides of the void. In at least one embodiment, the adjusting module further calculates normal vectors of the two triangles related to the bi-section. The two triangles related to the bi-section are the two triangles obtained by joining the endpoint of the bi-section with two vertices of the neighboring sides of the void on different sides separately. In at least one embodiment, the adjusting module obtains an angle to be rotated by the bi-section according to the normal vector of the starting point of the bi-section and the normal vectors of the two triangles related to the bi-section, and obtains two adjusted triangles according to the rotated angle of the bi-section.
In at least one embodiment, when the rotated angle of the bi-section is greater than zero, the bi-section is rotated upward to an absolute value of the rotated angle of the bi-section corresponding to the plane of the two triangles related to the bi-section by the adjusting module. When the rotated angle of the bi-section is less than zero, the bi-section is rotated downward to the absolute value of the rotated angle of the bi-section corresponding to the plane of the two triangles related to the bi-section by the adjusting module. When the rotated angle of the bi-section is equal to zero, the bi-section is kept unchanged by the adjusting module. The adjusting module obtains two adjusted triangles by joining the endpoint of the adjusted bi-section with the two vertices of the two neighboring sides of the void on different sides separately. The endpoint of the adjusted bi-section is a point that does not overlap with the vertex of the included angle of the two neighboring sides of the void.
At block 350, a smoothing module smoothes the patched point cloud, and outputs the patched point cloud to be displayed on a display screen of the computing device. In at least one embodiment, the smoothing module uses a preset smoothing method to smooth the patched point cloud. In at least one embodiment, the preset smoothing method can be, but is not limited to, moving along the directions of normal vectors of filled points in the void until the filled points satisfy a required accuracy of smoothness. The required accuracy of smoothness can be set up by the user or the point cloud patch system. The filled points in the void are endpoints of adjusted bi-sections in the void.
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. The functional code modules can be stored in any type of non-transitory readable medium or other storage device such as the storage device. 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 |
|---|---|---|---|
| 201410774967.5 | Dec 2014 | CN | national |