Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present invention and should not be construed as limiting the invention.
The following describes a processing method, a registration device and an intraoral scanning device of point cloud data according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for processing point cloud data according to an embodiment of the present invention. Referring to fig. 1, the method may include the steps of:
s101, determining a first registration point cloud of each point cloud according to a point-to-point registration result of the point cloud data.
S102, determining a second point cloud to be registered from the point cloud data.
In one embodiment of the invention, determining a second point cloud to be registered from point cloud data comprises determining a first point cloud, wherein an initial first point cloud and a neighborhood point cloud of the point cloud are obtained according to point-to-point registration results of the point cloud data, an initial curved surface to be registered is obtained by reconstructing the curved surface according to the initial first point cloud, determining the second point cloud to be registered from the neighborhood point cloud of the first point cloud, and when traversing the neighborhood point cloud of the first point cloud, re-determining the first point cloud according to all point-to-plane registration results and returning to the neighborhood point cloud of the first point cloud, and determining the second point cloud to be registered until registration and fusion of all point cloud data are completed.
The method comprises the steps of setting the attribute of an initial first point cloud as a first identifier, setting the initial attribute of other point clouds as a second identifier, setting the attribute of a second point cloud as the first identifier when the first registration point cloud of the second point cloud is matched with a curved surface to be registered, and determining a second point cloud to be registered from the neighborhood point clouds of the first point cloud, wherein the method comprises the steps of selecting one point cloud with the attribute of the second identifier from the neighborhood point clouds of the first point cloud and taking the point cloud as the second point cloud to be registered.
Specifically, the attribute of the initial first point cloud may be set to the first identifier False, and the attribute of the other point clouds may be set to the second identifier Ture.
In one embodiment of the invention, the initial first point cloud is obtained according to the following manner that a first registration return value of each point cloud in the point cloud data is determined from a point-to-point registration result of the point cloud data, and the point cloud corresponding to the first registration return value with the smallest value is taken as the initial first point cloud.
Specifically, during the real-time scanning, the first registration return value DRT [ i ] of the point cloud data, such as the ith point cloud Points [ i ], may be obtained based on the point-to-point registration result of the point cloud data. The DRT [ i ] is an average value of corresponding point distances between the ith point cloud [ i ] and the total point cloud after registration is completed, and the smaller the value is, the higher the registration precision is. And taking the corresponding point cloud with the minimum value of the first registration return value DRT [ i ] as an initial first point cloud.
In one embodiment of the invention, a neighborhood point cloud of each point cloud is obtained according to a point-to-point registration result of point cloud data, and the method comprises the steps of obtaining each point cloud and an initial rotation translation matrix corresponding to the each point cloud based on the point-to-point registration result of the point cloud data, obtaining barycenter coordinates and surrounding grids of the corresponding point cloud according to the initial rotation translation matrix, and determining the neighborhood point cloud of each point cloud according to the barycenter coordinates and the surrounding grids.
The method comprises the steps of calculating the gravity center distance of any two point clouds according to the gravity center coordinates of the two point clouds and calculating the coincidence ratio of the surrounding grids of the two point clouds, and if the gravity center distance is smaller than a preset distance threshold and the coincidence ratio is larger than the preset coincidence ratio threshold, marking one of the two point clouds as the neighborhood point cloud of the other one.
Specifically, as shown in fig. 2, based on the point-to-point registration result of the point cloud data, the point cloud data such as the ith point cloud Points [ i ], and the initial rotational translation matrix TFR [ i ] corresponding to the point cloud data may be obtained. After the initial rotation translation matrix TFR [ i ] of the ith point cloud [ i ] is obtained, the Points [ i ] can be transformed according to the TFR [ i ] to obtain transformed Points [ i ], then the gravity center of the Points [ i ] is obtained to obtain the gravity center coordinate pcenter [ i ] of the Points [ i ], and then the network bounding box is obtained to obtain the bounding grid pgrid [ i ] for pcenter [ i ].
Further, the gravity center distance of any two point clouds is calculated according to the gravity center coordinates of the two point clouds, and the coincidence ratio of surrounding grids of the two point clouds is calculated. If the center-of-gravity distance is smaller than a preset distance threshold (such as 5 mm) and the coincidence degree is larger than a preset coincidence degree threshold (such as 50%), one of the two point clouds is recorded as a neighborhood point cloud of the other one. The neighborhood point clouds can be numbered according to the sequence of the degree of overlap, and if N neighborhood point clouds of a certain point cloud exist, the N neighborhood point clouds can be numbered as 0,1,2 according to the degree of overlap from large to small. And then selecting the point cloud with the minimum registration return value DRT [ i ] as an initial first point cloud from the point cloud data, marking the point cloud as False, and reconstructing a target curved surface of the initial first point cloud to obtain an initial curved surface to be registered.
Further, after determining the initial first point cloud, a neighborhood point cloud with the number of 0 of the initial first point cloud may be preferentially selected as the second point cloud, where the point cloud attribute is identified as Ture and does not participate in point-to-face registration in the current traversal process. When all the neighborhood point clouds of the initial first point cloud are traversed, the first point cloud can be redetermined according to the registration results of all the points corresponding to the initial first point cloud to the surface, and the step of determining the second point cloud to be registered from the neighborhood point clouds of the first point cloud is returned until registration fusion of all the point cloud data is completed.
S103, determining a curved surface to be registered according to the curved surface of which registration fusion is completed currently.
And S104, performing point-to-surface registration on the first registration point cloud of the second point cloud and the curved surface to be registered.
The method comprises the steps of carrying out point-to-surface registration on a first registration point cloud of a second point cloud and a curved surface to be registered, wherein the point-to-surface registration is carried out on the first registration point cloud of the second point cloud and the curved surface to be registered, the method comprises the steps of obtaining a first rotation translation matrix according to the first registration point cloud of the current second point cloud and the curved surface to be registered, carrying out transformation on the first registration point cloud of the second point cloud by utilizing the first rotation translation matrix to obtain a first transformation point cloud, updating the first registration point cloud of the second point cloud by utilizing the first transformation point cloud, judging whether the first registration point cloud of the second point cloud meets a first preset condition or not, obtaining an approximation rotation translation matrix according to the first rotation translation matrix by utilizing an approximation algorithm if the number of times of the current point cloud meets the first preset condition, carrying out continuous multiple transformations on the first registration point cloud of the second point cloud by utilizing the approximation rotation translation matrix until the second preset condition is met, updating the first registration point cloud of the second point cloud by utilizing the approximation translation matrix, and judging whether the registration is completed or not according to the first registration point cloud of the current second point cloud and the curved surface to be registered, and if the registration is completed, returning to the first registration point cloud to be completed.
In one embodiment of the invention, determining the curved surface to be registered according to the curved surface which is completed with registration fusion currently comprises the steps of dividing the curved surface which is completed with registration fusion according to the surrounding grid of the first registration point cloud of the second point cloud to obtain the curved surface to be registered.
In this embodiment, after the first registration point cloud of the second point cloud and the curved surface after registration fusion is completed are obtained, the curved surface after registration fusion is completed is subjected to segmentation processing according to the surrounding grid of the first registration point cloud of the second point cloud, so as to obtain the curved surface to be registered, thereby effectively reducing the amount of data processing tasks and improving the registration efficiency of the first registration point cloud of the second point cloud and the current curved surface to be registered.
In one embodiment of the invention, obtaining a first rotational translation matrix according to a first registration point cloud of a current second point cloud and a curved surface to be registered can comprise dividing the curved surface to be registered according to each point in the first registration point cloud of the current second point cloud to obtain a target sub-curved surface corresponding to each point, obtaining registration point alignment of the first registration point cloud of the second point cloud according to each point in the first registration point cloud of the second point cloud and the corresponding target sub-curved surface, and obtaining the first rotational translation matrix according to the registration point alignment.
The method comprises the steps of dividing a to-be-registered curved surface according to each point in a first registration point cloud of a second point cloud, obtaining a target sub-curved surface corresponding to each point, wherein the step of correspondingly generating a three-dimensional bounding box around each point in the first registration point cloud of the second point cloud, and dividing the current to-be-registered curved surface according to the three-dimensional bounding box of each point to obtain the target sub-curved surface corresponding to each point.
Specifically, in the registering process of the first registration point cloud of the second point cloud and the current to-be-registered curved surface, the current to-be-registered curved surface can be further subjected to segmentation processing. As an example, a three-dimensional bounding box with a size of 5 x 5mm 3 or 9 x 9mm 3 can be correspondingly generated around each point in the first registration point cloud of the second point cloud, and then, re-segmenting the segmented current to-be-registered curved surface according to the three-dimensional bounding box of each point, so as to obtain a target sub-curved surface corresponding to each point. Thus, the accuracy of the registration of the dot surface can be improved.
In one embodiment of the invention, the target sub-surface is obtained according to triangular grid points, wherein the obtaining of the registration point pair of the first registration point cloud of the second point cloud according to each point in the first registration point cloud of the second point cloud and the corresponding target sub-surface comprises the steps of projecting each point in the first registration point cloud of the second point cloud on each triangular grid of the corresponding target sub-surface to obtain a corresponding projection point, calculating the distance between each point in the first registration point cloud of the second point cloud and each corresponding projection point to obtain a plurality of first distances, and obtaining the registration point pair of the second point cloud according to the plurality of first distances corresponding to each point in the first registration point cloud of the second point cloud.
Specifically, after the current surface to be registered obtained according to the triangular mesh points is divided, the obtained target sub-surface may include a plurality of triangular mesh surfaces. In this embodiment, each point, such as P point, in the first registration point cloud of the second point cloud may be aligned with each triangular mesh surface, such as G [ j ] (j=0, 1, m) projection is performed, and whether the corresponding projection point falls within the triangular mesh plane is judged. If so, the distance D [ i ] from the point P to the projection point is saved, wherein the method for acquiring the projection point can adopt an inner angle sum method, a homodromous method, an area method and a gravity center method.
The method comprises the steps of obtaining a registration point pair of a second point cloud according to a plurality of first distances corresponding to each point in the first registration point cloud of the second point cloud, selecting a projection point corresponding to the first distance with the smallest value from the corresponding plurality of first distances and forming the point pair with the point according to each point in the first registration point cloud of the second point cloud, obtaining the first point pair, discarding the point pair with the first point pair distance larger than the first preset distance, obtaining the second point pair, and obtaining the registration point pair of the first registration point cloud of the second point cloud according to the second point pair.
Specifically, taking the P point as an example, if the value of D5 in the first distances D1, D2, D3, D2, and D i corresponding to the P point is the smallest, the first point pair is formed by taking the projection point corresponding to D5 as P5 and P, and the first point pair can be obtained because the first registration point cloud of the second point cloud has a plurality of points. Referring to fig. 3, after obtaining a plurality of first point pairs, point pairs with a distance between a point of the first point pair and a projection point being greater than a first preset distance (e.g., 0.243-0.3 mm) may be discarded, so as to obtain a second point pair, and a registration point pair of the point cloud to be registered is obtained according to the second point pair.
In this embodiment, a first point pair is formed by selecting a point in the first registration point cloud of the second point cloud and a projection point with a minimum distance from the point to the projection point, and discarding a point with an excessively large distance from the point to the projection point, thereby improving accuracy of the registration point pair and further improving registration accuracy from point to surface.
In one embodiment of the invention, the second point pair comprises a first sub point cloud and a second sub point cloud, wherein points in the first sub point cloud are points in a first registration point cloud of the second point cloud, the points in the second sub point cloud are points on a current curved surface to be registered, the registration point pair of the first registration point cloud of the second point cloud is obtained according to the second point pair, the first zero point and the second zero point are determined, the coordinate value of the first zero point is the average value of the point coordinate values of the first sub point cloud, the coordinate value of the second zero point is the average value of all the point coordinate values of the second sub point cloud, the first registration point is obtained according to the weighted distance calculation of each point in the first sub point cloud and the first zero point, the second registration point is obtained according to the weighted distance calculation of each point in the second sub point cloud and the second zero point, and the first registration point is paired into the registration point pair.
The weighted distance may be calculated according to the following formula:
The weighting value dw [ i ] = (D-distance [ i ]) T [ i ], distance [ i ] is the minimum distance of the projection of the corresponding point, T [ i ] is the weighting coefficient, and D is the threshold, i.e. the first preset distance is 0.243-0.3mm.
I=0. Once again, the total number of components N, i=0......n, N is the number of the point pairs, R1 is a first registration point, P1 is a first sub-point cloud, and L1 is a first zero point.
I=0. Once again, the total number of components N, i=0......n, N is the number of the point pairs, R2 is a second registration point, P2 is a first sub-point cloud, and L2 is a first zero point.
It can be understood that the acquired second point pair is composed of a point in the first registration point cloud of the second point cloud and a projection point thereof, wherein the projection point is a point on the triangular mesh surface of the target sub-curved surface. Since the second point cloud has a plurality of points in the first registration point cloud, the second point pair may include a first sub point cloud and a second sub point cloud, where the points in the first sub point cloud are all points in the first registration point cloud of the second point cloud, and the points in the second sub point cloud are all points on the target surface. For example, the first sub-point cloud is a [ X ] = { P1, P2, P3 }, the second sub-point cloud is B [ X ] = { P11, P21, P31 }, the first sub-point cloud a [ X ] and the second sub-point cloud B [ X ] may constitute X second point pairs such as (Px, px 1), where Px1 is a projection point of Px.
Further, when the registration point pairs of the point cloud data are obtained according to the second point pairs, the first registration point a ' = { P10, P20, P30, px0} can be obtained by respectively obtaining the first zero point P0 and the second zero point P0' of the first sub-point cloud a [ X ] and the second sub-point cloud B [ X ], and then performing weighted distance calculation on each point P1, P2, P3, of the first sub-point cloud a [ X ] and the first zero point P0, respectively, and obtaining the first registration point a ' = { P10, P20, P30, px0} by performing weighted distance calculation on each point P1, P2, P3, of the first sub-point cloud a [ X ], P1 and the second zero point cloud B [ X ] { P1, P2, P3, P4, P0, P1, and the second zero point cloud B [ X ] = { P10, P20, P0, P1, and P0, respectively, and obtaining the weighted distances of the second sub-point cloud B [ X ] { P10, P1, P2, P3, P0.
In this embodiment, according to the calculation of the weighted distances between each point in the first sub-point cloud and the second sub-point cloud and the first zero point and the second zero point, respectively, a registration point pair is obtained, so that the influence factor of the point with the closer corresponding point distance is larger, and the registration efficiency is improved.
Further, a first rotation translation matrix T1 can be obtained through a quaternion method, a singular value decomposition method and other methods according to the alignment point pair A '- [ X ] -B' - [ X ], then a first transformation point cloud Q [ X ] is obtained through transforming a first sub-point cloud A [ X ] in a first alignment point cloud of a second point cloud through the first rotation translation matrix T1, a registration result of the first alignment point cloud of the second point cloud and a current curved surface to be registered is determined according to the first transformation point cloud Q [ X ], and the first sub-point cloud A [ X ] in the first alignment point cloud of the second point cloud is updated through the first transformation point cloud Q [ X ]. If the registration is not completed, the current point cloud conversion times are obtained, and whether the current point cloud conversion times meet a first preset condition is judged.
The number of times of the current point cloud transformation satisfying the first preset condition may include the number of times of the current point cloud transformation being less than or equal to a first preset value (e.g., 1 time). If the current point cloud transformation times exceeds the preset times (such as 5 times), the approximation step is skipped.
Referring to fig. 3, if the number of times of transformation of the current point cloud meets a first preset condition, for example, when the updated first registration point cloud of the second point cloud, that is, the first transformed point cloud qx, is obtained by performing primary transformation, that is, first transformation, on the first registration point cloud of the second point cloud, an approximation algorithm may be adopted to obtain an approximated rotational-translational matrix T according to the first rotational-translational matrix T1 by iteration. And continuously transforming the first registration point cloud of the second point cloud for a plurality of times by using the approximation rotation translation matrix T to obtain an approximation transformation point cloud until a second preset condition is met, and updating the first registration point cloud of the second point cloud by using the approximation transformation point cloud.
The obtaining an approximated rotational translation matrix T according to the first rotational translation matrix T1 by using an approximation algorithm may include obtaining a rotation angle (θx, θy, θz) and a translation amount h according to the first rotational translation matrix T1, calculating a first average distance dMean of a first registration point cloud of a second point cloud before updating and a second average distance dMean ' of a first transformation point cloud Q [ X ], wherein the first average distance dMean of the first registration point cloud of the second point cloud is an average value of distances between points on the first registration point cloud of the second point cloud and corresponding points on a surface to be registered in the registration point pair, and the second average distance dMean ' of the first transformation point cloud Q [ X ] is an average value of distances between points on the first transformation point cloud Q [ X ] and corresponding points on the surface to be registered in the registration point pair, and obtaining the approximated rotational translation matrix T according to the first average distance dMean, the second average distance dMean ', and the rotation angle (θx, θy, θz) and the translation amount h.
Wherein, obtaining the approximated rotational transformation matrix T according to the first average distance dMean, the second average distance dMean ', the rotation angle (θx, θy, θz), and the translation h may further include calculating a ratio of the second average distance dMean' to the first average distance dMean, and multiplying the ratio by the rotation angle (θx, θy, θz) and the translation h to obtain the approximated rotational translation matrix T.
Further, the method for continuously transforming the first registration point cloud of the second point cloud for multiple times by using the approximation rotation translation matrix to obtain an approximation transformation point cloud until a second preset condition is met can comprise the steps of transforming the first registration point cloud of the second point cloud by using the approximation rotation translation matrix to obtain the second transformation point cloud, calculating a second average distance of the second transformation point cloud, judging whether the second average distance is smaller than the second average distance calculated last time, wherein the second average distance of the second transformation point cloud is an average value of distances between points on the second transformation point cloud and corresponding points on a current curved surface to be registered in the registration point pair, updating the first registration point cloud of the second point cloud by using the second transformation point cloud if the second average distance is smaller than the first registration point cloud of the second point cloud, and returning to transform the first registration point cloud of the second point cloud by using the approximation rotation translation matrix to obtain the second transformation point cloud, and meeting the second preset condition if the second average distance is larger than or equal to the second average distance.
For example, the updated first registration point cloud, i.e., the first transformation point cloud qx, of the second point cloud is transformed by using the approximated rotational translation matrix T to obtain a second transformation point cloud qx ', and then a second average distance dMean ' of the second transformation point cloud qx ' is calculated, and then it is determined whether the second average distance dMean ' is smaller than the second average distance dMean ' calculated last time. If the calculated second average distance dMean ' is smaller than the calculated second average distance dMean ', the second average distance dMean ' of the first registration point cloud of the updated second point cloud is not reduced, and the first registration point cloud of the updated second point cloud meets a second preset condition.
And S105, judging whether the first registration point cloud is matched with the curved surface to be registered or not according to the registration result.
Specifically, the first registration point cloud of the second point cloud may be updated to approach the transformation point cloud, then whether dMean' at this time is smaller than a set threshold value is determined, if so, it is indicated that the first registration point cloud of the second point cloud and the curved surface to be registered satisfy the registration condition, and the registration is ended. Or judging whether the iteration times are larger than the set iteration times, if so, indicating that the first registration point cloud of the second point cloud and the curved surface to be registered do not meet the registration conditions, and ending the registration. If the two conditions are not met, iteration is carried out, then a first rotation translation matrix is obtained according to the updated first registration point cloud of the second point cloud and the curved surface to be registered, and the first rotation translation matrix is utilized to transform the updated first registration point cloud of the second point cloud until the transformed first registration point cloud of the second point cloud and the curved surface to be registered meet the registration conditions or the iteration times are exceeded.
And S106, if matched, carrying out surface fusion according to the registration result to obtain a new surface which is subjected to registration fusion, and returning to the step of determining a second point cloud to be registered from the point cloud data until all the point cloud data are subjected to registration fusion.
In one embodiment of the invention, the method can further comprise the steps of obtaining a second registration point cloud corresponding to the second point cloud when the first registration point cloud of the second point cloud is matched with the curved surface to be registered, calculating the average distance between the second registration point cloud and the nearest corresponding point on the curved surface to be registered, and recording the average distance as the nearest point distance, wherein the first point cloud is redetermined according to registration results of all points corresponding to the first point cloud, and comprises the steps of comparing all effective nearest point distances, updating the point cloud corresponding to the nearest point distance with the minimum value into the first point cloud, and setting the nearest point distance with the minimum value as invalid.
Specifically, a new first point cloud may be selected according to the average distance between the first registration point cloud of the second point cloud and the nearest corresponding point on the curved surface to be registered, that is, the value of the nearest point distance. Specifically, a point cloud with an effective closest point distance and a minimum value in a first registration point cloud of a second point cloud is selected as the first point cloud, the closest point distance is set to be invalid, and then the step of traversing the neighborhood point cloud of the first point cloud is returned until the neighborhood point cloud with the effective closest point distance is not traversed.
The method includes the steps of judging whether point clouds with the attribute of the second identifier Ture exist or not when effective closest point distances do not exist, judging that registration fusion of all point clouds is completed if the point clouds do not exist, and selecting one of the point clouds with the attribute of the second identifier Ture existing at present as a second point cloud to be registered if the point clouds exist, as shown in fig. 4. The method comprises the steps of carrying out point-to-surface registration on a first registration point cloud of a second point cloud and a current curved surface to be registered, judging whether the first registration point cloud of the second point cloud is matched with the curved surface to be registered according to registration results, carrying out curved surface fusion according to registration results to obtain a new curved surface to be registered, setting the attribute of the second point cloud as a first identifier False, taking the second point cloud as the first point cloud, returning the second point cloud to a neighborhood point cloud of the first point cloud, and determining the second point cloud to be registered, and returning to the step of judging whether the point cloud with the attribute of the second identifier Ture still exists if the point cloud is not matched.
According to the point cloud data processing method, through the point-to-point registration result of the point cloud data, the first registration point cloud of each point cloud is determined, the second point cloud to be registered is determined from the point cloud data, then the curved surface to be registered is determined according to the curved surface which is subjected to registration fusion currently completed, the first registration point cloud of the second point cloud and the curved surface to be registered are subjected to point-to-surface registration, then whether the first registration point cloud is matched with the curved surface to be registered or not is judged according to the registration result, if so, the curved surface fusion is performed according to the registration result, a new curved surface which is subjected to registration fusion completed is obtained, and the step of determining the second point cloud to be registered from the point cloud data is returned until the registration fusion is completed by all the point cloud data.
Furthermore, the invention also provides a registering device of the point cloud data, which comprises a memory, a processor and a computer program stored on the memory, wherein the computer program realizes the processing method of the point cloud data when being executed by the processor.
According to the point cloud data registration device, the accurate point-to-surface registration is realized through the point cloud data processing method, and the point-to-surface registration speed is improved.
Furthermore, the invention also provides intraoral scanning equipment. As shown in fig. 5, the intraoral scanning apparatus 1000 may include the above-described point cloud data registration device 100.
According to the intraoral scanning equipment provided by the embodiment of the invention, the point cloud data registration device realizes accurate point-to-surface registration through the processing method of the point cloud data, and the point-to-surface registration speed is improved.
According to the above-described embodiment, an example of a preferable setting will be described in detail below.
In the scanning process, the position error of the three-dimensional model data caused by the error of the data or the registration fusion error often exists, and the previous error is superposed when the next registration fusion is carried out according to the time sequence. And (3) selecting the spatial position with the best registration as a first point cloud, searching a neighborhood point cloud (a second point cloud) on the spatial position for registration, and matching and fusing the neighborhood point cloud (the second point cloud) to the first curved surface until the second point cloud is completely traversed. And then selecting the position with the best registration fusion result as a new first point cloud, continuously searching the neighborhood point cloud on the spatial position for registration fusion, and repeating the steps circularly until all the point clouds are registered and fused to the first curved surface.
If the registration effect is bad, and the original data is possibly problematic, the original data is affected by many factors, such as reflection, light transmission, movement, redundant soft tissues (such as tongue) and the like, which cause stripe extraction errors, the depth position of the reconstructed point is wrong, and the error can slowly smear the point in registration, so that the best point cloud matched with the registration is selected to create an initial first curved surface, and compared with other initial point clouds and initial curved surfaces, the superposition of errors can be reduced, and the registration accuracy is improved.
By combining the problems in the real-time scanning, the method has the advantages that the spatial information and the registration fusion precision are combined, on one hand, the spatial position with the highest precision is selected as the first point cloud through the registration fusion return result, and the problem that the position precision is inaccurate caused by the superposition of multiple point cloud errors is effectively avoided. On the other hand, the registration fusion of the multiple neighborhood point clouds effectively trowells the superposition influence of a single original point cloud error on the overall result, which is caused by shaking of a scanning process, hardware jump and the like, of a certain single image.
The overall flow is shown in FIG. 6, where the reference numeralsThe first stage judgment, the second stage judgment and the third stage judgment correspond to the following respectively, and pretreatment is carried out before the first stage judgment, the second stage judgment and the third stage judgment are carried out.
The pretreatment process is shown in fig. 7, and the pretreatment steps are as follows:
(1) Each point cloud (such as point cloud Points [ i ] of the ith frame), a corresponding rotation translation s matrix (such as rotation translation matrix TransFromRealTime [ i ] of the ith frame), and a registration return value of each point cloud (i.e. an average value of corresponding point distances between the point cloud and the total point cloud after registration is completed) can be obtained in time sequence in a real-time scanning process, wherein the smaller value is the better registration is, the more accurate the position is, and the registration return value of the ith frame is DISTREALTIME [ i ]).
After registration is completed, the total point cloud refers to all the point clouds which are completed in registration before the point cloud is completed, and the average value of the distances refers to the sum of the distances from each point in the point cloud to the corresponding point in the total point cloud divided by the point number of the point cloud, and then scanning is continued, and new point clouds continue to participate in registration.
Note that, the 1 st point cloud does not actually participate in registration, and two sets of point clouds (the existing point cloud and the overall point cloud) are required for registration, and only one set of point clouds is required in the 1 st point cloud, so that the first return value is 10000 (a set maximum value). The acquisition of a single point cloud of the jaw can reach about 2000, and the return value is only used for selecting the initial position, so that the first point cloud is not considered as the initial position and has no influence.
(2) The Points [ i ] are transformed according to the corresponding rotation translation matrix to obtain Points ' i ], the gravity center is obtained for the Points ' i to obtain gravity center coordinates pCenter [ i ], and the MC grid bounding box is obtained for the Points ' i to obtain a bounding grid pGrid [ i ]. The registration fusion is based on the idea of MC curved surface reconstruction, and not only requires the positions of points, but also needs to be attached with topological relations to reconstruct the subsequent MC curved surface, so that the MC curved surface can be directly obtained according to the positions of the triangular grid points and the topological information of the triangular grid points, and complete curved surface reconstruction is not needed.
(3) And calculating a neighborhood point cloud group of each point cloud, wherein if the barycentric coordinate distance of the point cloud is less than 5mm and the contact ratio of the surrounding grid is more than 50%, the neighborhood point cloud is defined. And numbering the neighborhood point clouds according to the sequence of the degree of overlap, wherein if the neighborhood point cloud group of a certain point cloud is provided with N neighborhood point clouds, the number is 0,1,2.
The barycentric coordinate distance refers to the distance between barycentric coordinates of Points [ i ] and Points [ j ], and the contact ratio of surrounding grids refers to the contact ratio of pGrid [ i ] and pGrid [ j ].
(4) Selecting DISTREALTIME [ i ] minimum corresponding point cloud as initial first point cloud, marking the point cloud attribute as False, marking other point clouds as Ture, and reconstructing MC curved surface by the first point cloud to form a first curved surface.
It should be noted that, by preprocessing, a neighborhood point cloud group (second point cloud) of each point cloud (first point cloud) may be obtained.
Further, as shown in fig. 8, the primary judgment process includes the following steps:
And (3) finding a second point cloud (neighborhood point cloud) with the number of 0 of the first point cloud, judging whether the point cloud attribute is Ture, if yes, entering a processing module, and if not, judging the next second point cloud with the number of 1 until all second point clouds are traversed.
The processing module comprises the following steps:
and performing matrix transformation of a corresponding rotation translation matrix TransFromRealTime [ i ] on the second point cloud to obtain a transformed third point cloud. And registering the third point cloud and the first curved surface from the point to the curved surface. And judging whether the third point cloud and the first curved surface are matched or not, if so, carrying out registration matrix transformation on the third point cloud to obtain a fourth point cloud, calculating the average distance between the fourth point cloud and the nearest corresponding point of the first curved surface, namely Dist [ i ], fusing the fourth point cloud MC to the first curved surface, and marking the attribute of the second point cloud as False.
If not, the next numbered second point cloud is judged.
It should be noted that, the neighborhood point cloud group of the first point cloud can be registered and fused through first-level judgment, so that the superposition influence of a single original point cloud error on the overall result, caused by shaking of the scanning process, hardware jump and the like, of a certain single image (the second point cloud) is effectively smoothed.
Further, the second-level judging step is that after the traversing process of the neighborhood point cloud (second point cloud) of the current first point cloud is completed, the second-level judging step is carried out, the point cloud with the effective and minimum Dist value corresponding to the point cloud group is found, the point cloud is used as the first point cloud, and the Dist of the point cloud group is set to be invalid. Returning to the first-level judgment to perform neighborhood traversal until the point cloud corresponding to the effective Dist cannot be found, and entering the third-level judgment, wherein the specific judgment steps are as follows:
And judging whether point clouds with the point cloud attribute of Ture exist, if not, finishing the registration and fusion of all the point clouds, and generating a final three-dimensional curved surface model. If yes, randomly selecting a point cloud with the point cloud attribute Ture as a second point cloud, registering the points to the curved surface, and judging whether a registration result meets a matching condition. If yes, marking the point cloud attribute of the current second point cloud as False, fusing the point cloud attribute into the first curved surface, and returning the point cloud attribute as the first point cloud to the first level judgment for neighborhood traversal. If the point cloud attribute does not meet the requirement, the third-level judgment is re-entered, and the point cloud with the other point cloud attribute Ture is selected.
Referring to fig. 9, the point-to-surface registration process used in the above process is as follows:
(1) The segmentation of a portion of the first surface (i.e., the second surface) according to the surrounding mesh of the point cloud involves the registration calculation of points to surfaces.
The first curved surface is gradually increased through multiple registration fusion, but the registration fusion of each step does not need to participate in the data of all the first curved surfaces, for example, the new point cloud is at the right molar position, the curved surface of the left molar is not needed to be calculated, and otherwise, the calculated amount is only increased.
(2) And forming a small bounding box for each point on the point cloud, and dividing the second curved surface into third curved surfaces according to the small bounding box, namely, each point on the point cloud corresponds to one third curved surface, and the whole point cloud corresponds to one third curved surface group.
Wherein the small bounding box is selectable according to a threshold, the threshold value is typically selected from a bounding box of 5 x 5 or 9 x 9.
(3) And (3) projecting the point P on the point cloud to each triangular mesh surface G [ j ] of the corresponding third curved surface (j=0, 1, the first and second surfaces, m) and judging whether the projected point falls in the triangular mesh, if so, storing the distance D [ i ] from the point on the point cloud to the projected point and the projected point coordinate Pro [ i ] (i=0, 1, the first and second surfaces, n, and knowing that n < =m. The total point cloud is obtained by fusion after each registration, the process is based on TSDF fusion of MC curved surfaces by the existing algorithm, whether triangles exist in each grid or not, the relationship between the triangles and the triangle vertexes (namely points on the grid edges) is always determined, and the topological relationship is always attached, so that the three points form one three grid surfaces is determined.
The method for obtaining the projection point can be obtained by an inner angle sum method, a homodromous method, an area method, a gravity center method and the like.
(4) And selecting the point with the smallest D [ i ] as the corresponding point of the point P, and removing the point pair with the distance larger than 0.245mm (the point with the distance larger than 0.245mm is considered as the point with the misregistration). And finally, forming corresponding point pairs A [ i ] (effective points on the point cloud) -B [ i ] (effective points on the third curved surface).
(5) And calculating coordinate value average point_a and point_b of two Point clouds of A [ i ] and B [ i ] respectively as zero points of the two Point clouds, and recalculating the Point cloud coordinates according to the weighted distance between each Point and the point_a and the weighted distance between each Point and the point_b, namely multiplying the weighted distance by the weighted value, and taking the calculated Point cloud coordinates as a new corresponding Point pair A '[ i ] -B' [ i ]. And then solving a rotation translation matrix Transform by a quaternion method, a singular value decomposition method and the like.
Wherein, the weighted value dw [ i ] = (D-distance [ i ]) ti [ i ], distance is the minimum distance obtained in step (4), T is the weighted coefficient, and D may be a threshold value determined according to the registration accuracy, similar to the test result or experience, or the like, that is, a first preset distance, for example, 0.243-0.3mm.
It should be noted that, the purpose of calculating the weighted distance is to control the influence of the corresponding point on the rotation translation matrix, so that the point influence factor of the corresponding point with a closer distance is larger, thereby accelerating the registration iteration times.
(6) And transforming the point cloud by using the rotation translation matrix, judging whether the point-to-point distance is small enough or not, and finishing registration if the point-to-point distance is satisfied with the condition, otherwise, repeating the steps (2), (3), (4), (5) and (6) until the matching condition is satisfied or the set iteration times are exceeded.
(7) When the rotation translation matrix transformation is performed for the first time, that is, when the iteration number is the first time, an additional operation is required, specifically, a rotation angle (θx, θy, θz) is calculated by the rotation translation matrix transformation, an approximation coefficient is calculated according to an average distance dMean of a point before rotation transformation and an average distance dMean 'after rotation transformation, delta= dMean'/dMean, and the approximation coefficient is multiplied by the rotation angle (θx, θy, θz) and the translation amount (Tx, ty, tz) to obtain a rotation translation matrix Δtransformation which is reversely calculated. And continuously performing rotation translation matrix delta Transform on the transformed point cloud for a plurality of times until dMean' is not reduced.
For the purpose of quick iteration, in practical engineering, it is found that multiple iterations are needed to match the point cloud with the first curved surface, that is, the iteration speed is too slow, and the point cloud can be quickly approximated to the first curved surface through the first rotation translation matrix transformation, so that the iteration times are reduced, and the registration speed is increased.
As shown in fig. 10 and 11, a set of data results of actual scanning processing are given, the accuracy obtained after real-time scanning is 0.098817mm in average distance, 0.092013mm in standard deviation, and the accuracy is improved to 0.041527mm in average distance and 0.041207mm in standard deviation after finishing optimization. Thus, the accuracy of the whole model can be effectively improved.
It should be noted that the logic and/or steps represented in the flowcharts or otherwise described herein, for example, may be considered as a ordered listing of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include an electrical connection (an electronic device) having one or more wires, a portable computer diskette (a magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.