This application claims priority to Chinese Patent Application No. 201410722204.6 filed on Dec. 3, 2014, the contents of which are incorporated by reference herein.
The subject matter herein relates to point clouds technology, and particularly to a computing device and a method for processing point clouds of an object.
A measurement device can measure a plurality of groups of incomplete point clouds by scanning a surface of an object (e.g., a component of a mobile phone). The groups of incomplete point clouds can be jointed to generate a complete point clouds of the object. However, the generation of the complete point clouds is complicated.
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 computing device 1 is connected to an input device 2 through a data cable 3. The input device 2 can be a keyboard or a mouse.
The acquisition module 100 acquires a first group of point clouds and a second group of point clouds of an object from the storage device 12. In at least one embodiment, the storage device 12 can store a plurality of groups of point clouds of one object which can be integrated to form a complete point clouds of the object. The acquisition module 100 first selects two groups of point clouds of the object which are required to be jointed. After the first group of point clouds and the second group of point clouds are jointed completely, the acquisition module 100 continuously selects another group of point clouds in the storage device 12 to be jointed with the above jointed point clouds, until all groups of point clouds of the object have been jointed to form the complete point clouds of the object.
The acquisition module 100 further predetermines a preset precision value. In at least one embodiment, the preset precision value can be predetermined according to user input. For example, an user can input the preset precision value using the input device 2 according to a precision requirement of jointing the first group of point clouds and the second group of point clouds.
The jointing module 101 joints the first group of point clouds and the second group of point clouds initially to form first jointed point clouds. In at least one embodiment, the first group of point clouds and the second group of point clouds can be jointed initially by executing a manual jointing method or a coarse jointing method to align the first group of point clouds and the second group of point clouds approximately. The manual jointing method represents that the user can align the first group of point clouds and the second group of point clouds by manual operations. The coarse jointing method can be a turntable method, a labeling method, for example. In order to initially joint the first group of point clouds and the second group of point clouds quickly, the jointing module 101 can filter the first group of point clouds and the second group of point clouds by removing noise points of the first and the second groups of point clouds before jointing the first group of point clouds and the second group of point clouds.
The fitting module 102 identifies an overlap area of the first jointed point clouds where the first group of point clouds overlaps with the second group of point clouds, and fits two pieces of point clouds on the overlap area (for example, partial point clouds of the first group of point clouds and the second group of point clouds) to a first curved surface and a second curved surface. In at least one embodiment, the fitting module 102 fits the two pieces of point clouds of the overlap area according to a cubic spline surface fitting method and a Quasi-Newton iterative method.
In at least one embodiment, the cubic spline surface fitting method includes a preset equation of
In the preset equation, “S(u , v)” represents the curved surface, “Nik” and “Njl” represent continuous first-order derivative and second-order derivative. The fitting module 102 can preset the curved surface “S(u, v)” and a point “M”, and a distance “V” between the point “M” and an arbitrary point “C(u, v)” on the curved surface “S(u, v)” can be represented as a formula of “V(u, v)=C(u, v)−M”. In order to acquire a solution when “V(u, v)” is least, the fitting module 102 uses a Jacobian matrix and partial derivatives of the curved surface “S(u, v)” for executing the Quasi-Newton iterative method, for example, using “k=−Js*(Su, Sv)” as an iteration step to execute the iterative method.
The calculation module 103 calculates initial correspondence points in the first group of point clouds and the second group of point clouds according to the first curved surface and the second curved surface, and obtains a first set of initial correspondence points and a second set of initial correspondence points. In at least one embodiment, the calculation module 103 uses a rectangle to surround the overlap area, and divides the rectangle into a plurality of sub-rectangles. The calculation module 103 determines two projective points on the first curved surface and the second curved surface projected by a center point of each sub-rectangle, and determines the two projective points corresponding to each sub-rectangle as a pair of correspondence points. The calculation module 103 obtains the first set of initial correspondence points and the second set of initial correspondence points in the first group of point clouds and the second group of point clouds according to the pair of correspondence points of each sub-rectangle.
The modification module 104 obtains a first set of updated correspondence points and a second set of updated correspondence points by deleting abnormal points in the first set of initial correspondence points and the second set of initial correspondence points according to a preset rule. In at least one embodiment, the preset rule includes calculating a distance between each pair of the correspondence points in the first set of initial correspondence points and the second set of initial correspondence points, and deleting a selected pair of the correspondence points from the first set of initial correspondence points and the second set of initial correspondence points when a distance between the selected pair of the correspondence points is larger than or equal to a preset threshold value.
For example, if the first set of initial correspondence points of the first group of point clouds is represented as “P”, and the second set of initial correspondence points of the second group of point clouds is represented as “Q”. Each set of “P” and “Q” includes a number of “n” points. The modification module 104 determines a standard deviation of
as the preset threshold value. Therefore, the modification module 104 determines the pair of the correspondence points which match a condition of “∥Pi−Qi∥22≧D” as the abnormal points, and deletes the abnormal points. That is, the modification module 104 reserves the pair of the correspondence points which match a condition of “∥Pi−Qi∥22<D” in the first set of initial correspondence points and the second set of initial correspondence points as the first updated set of correspondence points and the second updated set of correspondence points.
The calculation module 103 further calculates a conversion relationship between the first group of point clouds and the second group of point clouds by executing a least square method based on the first and the second updated sets of correspondence points, and calculates a least square solution of an objective function corresponding to the conversion relationship. In at least one embodiment, if the first updated set of correspondence points and the second updated set of correspondence points are represented as “P(ax, ay, az, 1)” and “Q(bx, by, bz, 1)” respectively, and an ideal conversion relationship between the first group of point clouds and the second group of point clouds is represented as “P*T=Q,” which is a super linear equation and has a least square solution. “T” represents a 4*3 transition matrix. An objective function corresponding to the conversion relationship is represented as
A coordinate relationship between each pair of correspondence points in the first updated set of correspondence points and the second updated set of correspondence points can be represented as “A*T=B”, and “A”, “B” are represented by the following equations:
If “X0” matches an equation of “∥AX0−B∥2=min∥AX0−B∥2”, “X0” is the least square solution, and a general solution is represented as “X=A+B+(I−A+A)Y”. The minimum value of the least square solution is unique. Therefore, an equation of “X0=A+B” is obtained, and “A+” represents generalized inverse of “A”. The calculation module 103 determines “ε=∥AX0−B∥” as the least square solution of the objective function, and the value of the least square solution represents a precision.
The processing module 105 determines whether the calculated least square solution is less than or equal to the preset precision value. If the calculated least square solution is less than or equal to the preset precision value, the processing module 105 further converts first group of point clouds according to the conversion relationship calculated based on the calculated least square solution, and joints the converted first group of point clouds with the second group of point clouds to form second jointed point clouds, and outputs the second jointed point clouds to be displayed on the display screen 13. If the calculated least square solution is greater than the preset precision value, the fitting module 102 continuously executes the iterative method to fit the curved surfaces, and recalculates the least square solution of the objective function corresponding to the conversion relationship until the calculated least square solution is less than or equal to the preset precision value.
In at least one embodiment, before outputting the second jointed point cloud, the processing module 105 can simplify an overlap area of the second jointed point clouds where the converted first group of point clouds overlaps with the second group of point clouds by executing preset simplification methods, and smooth the overlap area of the second jointed point clouds by executing preset smoothing methods.
Referring to
At block 301, an acquisition module acquires a first group of point clouds and a second group of point clouds of an object from the storage device 12, and predetermines a preset precision value. In at least one embodiment, the storage device 12 can store a plurality of groups of point clouds of one object which can be integrated to form a complete point clouds of the object. The acquisition module first selects two groups of point clouds of the object which is required to be jointed. After the above two groups of point clouds are completely jointed, the acquisition module continuously selects one group of point clouds to be jointed with the above jointed point clouds, until all groups of point clouds of the object have been jointed to form a complete point clouds of the object. In at least one embodiment, the preset precision value can be predetermined according to user input. For example, a user can input the preset precision value using the input device 2 according to a precision requirement of jointing the first group of point clouds and the second group of point clouds.
At block 302, a jointing module joints the first group of point clouds and the second group of point clouds initially to form first jointed point clouds. In at least one embodiment, the first group of point clouds and the second group of point clouds can be jointed initially by executing a manual jointing method or a coarse jointing method to align the first group of point clouds and the second group of point clouds approximately. The manual jointing method represents that the user can align the first group of point clouds and the second group of point clouds manually. The coarse jointing method can be a turntable method, a labeling method, for example. In order to initially joint the first group of point clouds and the second group of point clouds quickly, the joint module 101 can filter the first group of point clouds and the second group of point clouds by removing noise points of the first group of point clouds and the second group of point clouds before jointing the first group of point clouds and the second group of point clouds.
At block 303, a fitting module identifies an overlap area of the first jointed point clouds where the first group of point clouds overlaps with the second group of point clouds, and fits two pieces of point clouds on the overlap area (for example, partial point clouds of the first group of point clouds and the second group of point clouds) to a first curved surface and a second curved surface. In at least one embodiment, the fitting module 102 fits the point clouds of the overlap area according to a cubic spline surface fitting method and a Quasi-Newton iterative method.
In at least one embodiment, the cubic spline surface fitting method includes a preset equation of
In the preset equation, “S(u, v)” represents the curved surface, “Nik” and “Njl” represent continuous first-order derivative and second-order derivative. The fitting module 102 can preset the curved surface “S(u, v)” and a point “M”, and a distance “V” between the point “M” and an arbitrary point “C(u, v)” on the curved surface “S(u,v)” can be represented as a formula of “V(u,v)=C(u,v)−M)”. In order to acquire a solution when “V(u, v)” is least, the fitting module 102 uses a Jacobian matrix and partial derivatives of the curved surface “S(u, v)” for executing the Quasi-Newton iterative method, for example, using “k=−Js*(Su, Sv)” as an iteration step to execute the iterative method.
At block 304, a calculation module calculates initial correspondence points in the first group of point clouds and the second group of point clouds according to the first curved surface and the second curved surface, and obtains a first set of initial correspondence points and a second set of initial correspondence points. In at least one embodiment, the calculation module 103 uses a rectangle to surround the overlap area, and divides the rectangle into a plurality of sub-rectangles. The calculation module 103 determines two projective points on the first curved surface and the second curved surface projected by a center point of each sub-rectangle, and determines the two projective points corresponding to each sub-rectangle as a pair of correspondence points. The calculation module 103 obtains the first set of initial correspondence points and the second set of initial correspondence points in the first group of point clouds and the second group of point clouds according to the pair of correspondence points of each sub-rectangle.
At block 305, a modification module obtains a first set of updated correspondence points and a second set of updated correspondence points by deleting abnormal points in the first set of initial correspondence points and the second set of initial correspondence points according to a preset rule. In at least one embodiment, the preset rule includes calculating a distance between each pair of the correspondence points in the first set of initial correspondence points and the second set of initial correspondence points, and deleting a selected pair of the correspondence points from the first set of initial correspondence points and the second set of initial correspondence points when a distance between the selected pair of the correspondence points is larger than or equal to a preset threshold value.
At block 306, the calculation module further calculates a conversion relationship between the first group of point clouds and the second group of point clouds by executing a least square method based on the first updated set of correspondence points and the second updated set of correspondence points, and calculates a least square solution of an objective function corresponding to the conversion relationship. In at least one embodiment, if the first updated set of correspondence points and the second updated set of correspondence points are represented as “P(ax, ay, az, 1)” and “Q(bx, by, bz, 1)” respectively, and an ideal conversion relationship between the first group of point clouds and the second group of point clouds is represented as “P*T=Q,” which is a super linear equation and has a least square solution. “T” represents a 4*3 transition matrix. An objective function corresponding to the conversion relationship is represented as
A coordinate relationship between each pair of correspondence points in the first updated set of correspondence points and the second updated set of correspondence points can be represented as “A*T=B”, and “A”, “B” are represented by the following equations:
If “X0” matches an equation of “∥AX0−B∥2=min∥AX0−B∥2”, “X0” is the least square solution, and a general solution is represented as “X=A+B+(I−A+A)Y”. The minimum value of the least square solution is unique. Therefore, an equation of “X0=A+B” is obtained, and “A+” represents generalized inverse of “A”. The calculation module 103 determines “ε=∥AX0−B∥” as the least square solution of the objective function, and the value of the least square solution represents a precision.
At block 307, a processing module determines whether the calculated least square solution is less than or equal to the preset precision value. If the calculated least square solution is less than or equal to the preset precision value, block 308 is implemented. If the calculated least square solution is greater than the preset precision value, block 303 is repeated to continuously execute the iterative method to fit the curved surfaces.
At block 308, the processing module further converts first group of point clouds according to the conversion relationship calculated based on the calculated least square solution, and joints the converted group of point clouds with another group of point clouds to be second jointed point clouds, and outputs the second jointed point clouds to be displayed on the display screen 13.
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 |
---|---|---|---|
201410722204.6 | Dec 2014 | CN | national |