Disclosure of Invention
The present invention aims to provide a 3D-DIC-based dental crack detection method, which solves the above-mentioned problems of the background art by various improvements.
In order to achieve the above purpose, the present invention provides the following technical solutions:
A 3D-DIC based dental crack detection method, comprising the steps of:
S1, spraying black ink on the surface of teeth by using a spray pen, so that the ink is uniformly distributed on the surface of the teeth in a dense spot shape, wherein the spot set is called a speckle pattern, an image of the teeth is obtained by a binocular camera and is divided into a left view and a right view, and the left view and the right view without distortion are obtained after correction;
S2, extracting the areas where the teeth are located in the left view and the right view to obtain an image only containing the teeth;
s3, carrying out three-dimensional matching on the areas where the teeth are located in the left view and the right view, wherein the three-dimensional matching is to find a matching pixel of one pixel in the left view and the right view, and carrying out matching cost calculation on each pair of pixels;
s4, calculating a parallax value of each pair of pixel points to obtain a parallax map;
s5, performing post-processing on the parallax map to obtain a smooth parallax map;
S6, mapping the parallax image into a three-dimensional space according to a triangle principle to form a point cloud, then processing the next pair of images to obtain the point cloud, and registering the point cloud with the point cloud of the last pair of images to obtain a fused point cloud;
and S7, applying pressure parallel to the tooth section to the side surface of the target tooth, wherein the pressure is not more than 2N. Repeating the steps S1-S6 on the teeth subjected to the pressure to obtain another point cloud;
and S8, comparing the two point clouds obtained in the step S7, calculating according to a 3D-DIC method to obtain a displacement field, and further calculating to obtain a strain field.
And S9, analyzing the strain field to obtain the position of the main crack.
Preferably, the camera in S1 rotates about the tooth center axis, acquires a pair of images every 5 degrees of rotation, and corrects the images.
Preferably, the stereo matching in S3 includes cost calculation and cost aggregation, where a cost calculation criterion is ZNCC (normalized cross correlation criterion), and a pairing point of each pixel of the left view is found in the right view, and the higher the cost value is, the higher the similarity is, and by using a limit constraint, the search range can be reduced, and the calculation resource consumption is reduced, and the polar constraint, that is, in the left view and the right view shot by the corrected binocular camera, each pair of matched pixels should be on a straight line.
Preferably, after the cost calculation in the step S3 is completed, a cost space is obtained, cost aggregation is performed in the cost space, the cost aggregation is combined with global information to optimize the cost value of the pixels, a more accurate cost value is obtained, and after the cost matching is completed, each pixel selects the lowest cost value of the pixels, and a disparity map is calculated.
Preferably, the disparity map in S4 still has certain noise due to mismatching after stereo matching, and needs to be subjected to post-processing such as left-right consistency check, median filtering, hole filling, etc., wherein the left-right consistency check is to change left-right views, stereo matching is performed again, pixels with offset distances exceeding the limit before and after the check are regarded as mismatching, and the pixels are deleted, and the median filtering is used for removing noise points, smoothing the disparity map, and filling the hole, so as to fill the missing hole therein.
Preferably, after the second group of point clouds is generated in S6, the generated point clouds have a certain distance offset due to error reasons, and the two point clouds need to be registered and fused into one point cloud, and the nearest neighbor iterative algorithm is adopted for fusion.
Preferably, the steps are repeated until all the pictures are calculated, preliminary tooth three-dimensional point cloud data are obtained at the moment, after the point cloud picture is obtained, post-processing is needed, the post-processing comprises filtering to remove outliers, filling holes and the like, the point cloud is subjected to curved surface reconstruction to obtain a three-dimensional model, and a poisson reconstruction method is adopted for curved surface reconstruction.
Preferably, in the step S7, pressure is applied to both sides of the tooth, and the steps S1 to S7 are repeated to obtain the three-dimensional model of the tooth after the pressure is applied.
Preferably, the three-dimensional tooth models before and after the stress deformation are compared, points with high correlation degree are matched through a three-dimensional digital image correlation method (3D-DIC), displacement information and strain information of the point pairs are obtained through calculation, and the three-dimensional strain field of the whole tooth is obtained after matching of all points in the point cloud set is completed.
Preferably, the characteristic that the crack region is more sensitive to pressure is utilized to find the position with the largest strain in the three-dimensional strain field, namely the position where the crack is located, according to the principle, firstly, a threshold value is set to eliminate the interference of fine crack branches to the main crack, then a search step length is set, and the high strain region in the three-dimensional strain field, namely the region where the crack is located, is extracted through iteration.
The tooth crack detection method based on the 3D-DIC provided by the invention has the following beneficial effects:
according to the invention, the left view and the right view are subjected to three-dimensional matching by extracting the areas of teeth in the image to obtain the parallax image, and the parallax image is subjected to post-processing, so that the searching range can be reduced, and the consumption of computing resources is reduced.
Detailed Description
Example 1
As shown in fig. 1, the tooth crack detection method based on 3D-DIC provided by the present invention comprises the following steps:
S1, spraying black ink on the surface of teeth by using a spray pen, so that the ink is uniformly distributed on the surface of the teeth in a dense spot shape, wherein the spot set is called a speckle pattern, an image of the teeth is obtained by a binocular camera and is divided into a left view and a right view, and the left view and the right view without distortion are obtained after correction;
S2, extracting the areas where the teeth are located in the left view and the right view to obtain an image only containing the teeth;
s3, three-dimensional matching is carried out on the area where the teeth in the left view and the right view are located, namely, for one pixel in the left view, a matching pixel in the right view is found, matching cost calculation is carried out on each pair of pixels, three-dimensional matching comprises cost calculation and cost aggregation, a cost calculation criterion adopts ZNCC (normalized cross correlation criterion), the matching point of each pixel in the left view is searched in the right view, the higher the cost value is, the higher the similarity is, the limit constraint is utilized, the searching range can be reduced, the calculation resource consumption is reduced, the line constraint, namely, in the left view and the right view shot by the corrected binocular camera, each pair of matched pixels is on a straight line, a cost space is obtained after cost calculation is completed, cost aggregation is carried out in the cost space, the cost aggregation is combined with global information to optimize the cost value of the pixels, a more accurate cost value is obtained, and after the cost matching is completed, each pixel is selected to have the lowest cost value, and the parallax image is calculated;
S4, calculating the parallax value of each pair of pixel points to obtain a parallax image, wherein the parallax image still has certain noise due to mismatching and the like after three-dimensional matching, and needs to be subjected to post-processing such as left and right consistency check, median filtering and hole filling, wherein the left and right consistency check is to change left and right views, the three-dimensional matching is performed again, the pixels with the offset distance exceeding the limit before and after the check are regarded as mismatching, the pixels are deleted, the median filtering is used for removing the noise points, smoothing the parallax image and filling the holes, and the missing holes are filled;
s5, performing post-processing on the parallax map to obtain a smooth parallax map;
S6, mapping the parallax image into a three-dimensional space according to a triangle principle to form a point cloud, then processing the next pair of images to obtain the point cloud, registering the point cloud with the last pair of image point clouds to obtain a fused point cloud, and after the second group of point clouds are generated, because of error reasons, the generated point clouds have offset with a certain distance, registering the two point clouds, fusing the two point clouds into one point cloud, and fusing the two point clouds into a nearest neighbor iterative algorithm;
S7, applying pressure parallel to the section of the tooth to the side surface of the target tooth, applying pressure to the two sides of the tooth when the pressure is not more than 0.5N, repeating the steps to obtain a tooth three-dimensional model after the pressure is applied, comparing the two tooth models, calculating the time of a displacement field of the two tooth models to be 1 second, finding out the position with obvious displacement as the position of a crack, repeating the steps until all pictures finish calculation, obtaining preliminary tooth three-dimensional point cloud data at the moment, and after obtaining a point cloud picture, carrying out post-processing on the point cloud picture, wherein the post-processing comprises filtering to remove outliers, filling cavities and the like, carrying out curved surface reconstruction on the point cloud to obtain a three-dimensional model, and adopting a poisson reconstruction method for curved surface reconstruction;
And S8, comparing the two point clouds obtained in the step S7, calculating according to a 3D-DIC method to obtain a displacement field, and further calculating to obtain a strain field. And finally analyzing the strain field to obtain the position of the main crack, comparing the tooth three-dimensional models before and after the forced deformation, matching the points with higher correlation degree through a three-dimensional digital image correlation method (3D-DIC), calculating to obtain displacement information and strain information of the point pair, and obtaining the three-dimensional strain field of the whole tooth after matching all the points in the point cloud set.
And S9, finding the position with the largest strain in the three-dimensional strain field by utilizing the characteristic that the crack area is more sensitive to pressure, namely, the position where the crack is located, firstly setting a threshold value according to the principle, eliminating the interference of the tiny crack branches on the main crack, then setting a search step length, and extracting the high-strain area in the three-dimensional strain field, namely, the area where the crack is located through iteration.
Example two
As shown in fig. 1, the 3D-DIC-based dental crack detection method of the present invention comprises the steps of:
S1, spraying black ink on the surface of teeth by using a spray pen, so that the ink is uniformly distributed on the surface of the teeth in a dense spot shape, wherein the spot set is called a speckle pattern, an image of the teeth is obtained by a binocular camera and is divided into a left view and a right view, and the left view and the right view without distortion are obtained after correction;
S2, extracting the areas where the teeth are located in the left view and the right view to obtain an image only containing the teeth;
s3, three-dimensional matching is carried out on the area where the teeth in the left view and the right view are located, namely, for one pixel in the left view, a matching pixel in the right view is found, matching cost calculation is carried out on each pair of pixels, three-dimensional matching comprises cost calculation and cost aggregation, a cost calculation criterion adopts ZNCC (normalized cross correlation criterion), the matching point of each pixel in the left view is searched in the right view, the higher the cost value is, the higher the similarity is, the limit constraint is utilized, the searching range can be reduced, the calculation resource consumption is reduced, the line constraint, namely, in the left view and the right view shot by the corrected binocular camera, each pair of matched pixels is on a straight line, a cost space is obtained after cost calculation is completed, cost aggregation is carried out in the cost space, the cost aggregation is combined with global information to optimize the cost value of the pixels, a more accurate cost value is obtained, and after the cost matching is completed, each pixel is selected to have the lowest cost value, and the parallax image is calculated;
S4, calculating the parallax value of each pair of pixel points to obtain a parallax image, wherein the parallax image still has certain noise due to mismatching and the like after three-dimensional matching, and needs to be subjected to post-processing such as left and right consistency check, median filtering and hole filling, wherein the left and right consistency check is to change left and right views, the three-dimensional matching is performed again, the pixels with the offset distance exceeding the limit before and after the check are regarded as mismatching, the pixels are deleted, the median filtering is used for removing the noise points, smoothing the parallax image and filling the holes, and the missing holes are filled;
s5, performing post-processing on the parallax map to obtain a smooth parallax map;
S6, mapping the parallax image into a three-dimensional space according to a triangle principle to form a point cloud, then processing the next pair of images to obtain the point cloud, registering the point cloud with the last pair of image point clouds to obtain a fused point cloud, and after the second group of point clouds are generated, because of error reasons, the generated point clouds have offset with a certain distance, registering the two point clouds, fusing the two point clouds into one point cloud, and fusing the two point clouds into a nearest neighbor iterative algorithm;
S7, applying pressure parallel to the section of the tooth to the side surface of the target tooth, applying pressure to the two sides of the tooth when the pressure is not more than 1N, repeating the steps to obtain a tooth three-dimensional model after the pressure is applied, comparing the two tooth models, calculating the time of a displacement field of the two tooth models to be 2 seconds, finding out a position with obvious displacement, namely a position where a crack is located, repeating the steps until all pictures finish calculation, obtaining preliminary tooth three-dimensional point cloud data, and after obtaining a point cloud picture, carrying out post-treatment on the point cloud picture, wherein the post-treatment comprises filtering to remove outliers, filling cavities and the like, carrying out curved surface reconstruction on the point cloud to obtain a three-dimensional model, and adopting a Poisson reconstruction method for curved surface reconstruction;
And S8, comparing the two point clouds obtained in the step S7, calculating according to a 3D-DIC method to obtain a displacement field, and further calculating to obtain a strain field. Finally analyzing the strain field to obtain the position of the main crack, comparing the tooth three-dimensional models before and after stress deformation, matching the points with higher correlation degree through a three-dimensional digital image correlation method (3D-DIC), calculating to obtain displacement information and strain information of the point pairs, and obtaining the three-dimensional strain field of the whole tooth after matching all points in the point cloud set is completed
And S9, finding the position with the largest strain in the three-dimensional strain field by utilizing the characteristic that the crack area is more sensitive to pressure, namely, the position where the crack is located, firstly setting a threshold value according to the principle, eliminating the interference of the tiny crack branches on the main crack, then setting a search step length, and extracting the high-strain area in the three-dimensional strain field, namely, the area where the crack is located through iteration.
Example III
As shown in fig. 1, the tooth crack detection method based on 3D-DIC provided by the present invention comprises the following steps:
S1, spraying black ink on the surface of teeth by using a spray pen, so that the ink is uniformly distributed on the surface of the teeth in a dense spot shape, wherein the spot set is called a speckle pattern, an image of the teeth is obtained by a binocular camera and is divided into a left view and a right view, and the left view and the right view without distortion are obtained after correction;
S2, extracting the areas where the teeth are located in the left view and the right view to obtain an image only containing the teeth;
s3, three-dimensional matching is carried out on the area where the teeth in the left view and the right view are located, namely, for one pixel in the left view, a matching pixel in the right view is found, matching cost calculation is carried out on each pair of pixels, three-dimensional matching comprises cost calculation and cost aggregation, a cost calculation criterion adopts ZNCC (normalized cross correlation criterion), the matching point of each pixel in the left view is searched in the right view, the higher the cost value is, the higher the similarity is, the limit constraint is utilized, the searching range can be reduced, the calculation resource consumption is reduced, the line constraint, namely, in the left view and the right view shot by the corrected binocular camera, each pair of matched pixels is on a straight line, a cost space is obtained after cost calculation is completed, cost aggregation is carried out in the cost space, the cost aggregation is combined with global information to optimize the cost value of the pixels, a more accurate cost value is obtained, and after the cost matching is completed, each pixel is selected to have the lowest cost value, and the parallax image is calculated;
S4, calculating the parallax value of each pair of pixel points to obtain a parallax image, wherein the parallax image still has certain noise due to mismatching and the like after three-dimensional matching, and needs to be subjected to post-processing such as left and right consistency check, median filtering and hole filling, wherein the left and right consistency check is to change left and right views, the three-dimensional matching is performed again, the pixels with the offset distance exceeding the limit before and after the check are regarded as mismatching, the pixels are deleted, the median filtering is used for removing the noise points, smoothing the parallax image and filling the holes, and the missing holes are filled;
s5, performing post-processing on the parallax map to obtain a smooth parallax map;
S6, mapping the parallax image into a three-dimensional space according to a triangle principle to form a point cloud, then processing the next pair of images to obtain the point cloud, registering the point cloud with the last pair of image point clouds to obtain a fused point cloud, and after the second group of point clouds are generated, because of error reasons, the generated point clouds have offset with a certain distance, registering the two point clouds, fusing the two point clouds into one point cloud, and fusing the two point clouds into a nearest neighbor iterative algorithm;
S7, applying pressure parallel to the section of the tooth to the side surface of the target tooth, applying pressure to the two sides of the tooth when the pressure is not more than 1.5N, repeating the steps to obtain a tooth three-dimensional model after the pressure is applied, comparing the two tooth models, calculating the time of a displacement field of the two tooth models to be 3 seconds, finding out the position with obvious displacement, namely the position where a crack is located, repeating the steps until all pictures finish calculation, obtaining preliminary tooth three-dimensional point cloud data at the moment, and after obtaining a point cloud picture, carrying out post-processing on the point cloud picture, wherein the post-processing comprises filtering to remove outliers, filling cavities and the like, carrying out curved surface reconstruction on the point cloud to obtain a three-dimensional model, and adopting a poisson reconstruction method for curved surface reconstruction;
And S8, comparing the two point clouds obtained in the step S7, calculating according to a 3D-DIC method to obtain a displacement field, and further calculating to obtain a strain field. Finally analyzing the strain field to obtain the position of the main crack, comparing the tooth three-dimensional models before and after stress deformation, matching the points with higher correlation degree through a three-dimensional digital image correlation method (3D-DIC), calculating to obtain displacement information and strain information of the point pairs, and obtaining the three-dimensional strain field of the whole tooth after matching all points in the point cloud set is completed
And S9, finding the position with the largest strain in the three-dimensional strain field by utilizing the characteristic that the crack area is more sensitive to pressure, namely, the position where the crack is located, firstly setting a threshold value according to the principle, eliminating the interference of the tiny crack branches on the main crack, then setting a search step length, and extracting the high-strain area in the three-dimensional strain field, namely, the area where the crack is located through iteration.
Example IV
As shown in fig. 1, the tooth crack detection method based on 3D-DIC provided by the present invention comprises the following steps:
S1, spraying black ink on the surface of teeth by using a spray pen, so that the ink is uniformly distributed on the surface of the teeth in a dense spot shape, wherein the spot set is called a speckle pattern, an image of the teeth is obtained by a binocular camera and is divided into a left view and a right view, and the left view and the right view without distortion are obtained after correction;
S2, extracting the areas where the teeth are located in the left view and the right view to obtain an image only containing the teeth;
s3, three-dimensional matching is carried out on the area where the teeth in the left view and the right view are located, namely, for one pixel in the left view, a matching pixel in the right view is found, matching cost calculation is carried out on each pair of pixels, three-dimensional matching comprises cost calculation and cost aggregation, a cost calculation criterion adopts ZNCC (normalized cross correlation criterion), the matching point of each pixel in the left view is searched in the right view, the higher the cost value is, the higher the similarity is, the limit constraint is utilized, the searching range can be reduced, the calculation resource consumption is reduced, the line constraint, namely, in the left view and the right view shot by the corrected binocular camera, each pair of matched pixels is on a straight line, a cost space is obtained after cost calculation is completed, cost aggregation is carried out in the cost space, the cost aggregation is combined with global information to optimize the cost value of the pixels, a more accurate cost value is obtained, and after the cost matching is completed, each pixel is selected to have the lowest cost value, and the parallax image is calculated;
S4, calculating the parallax value of each pair of pixel points to obtain a parallax image, wherein the parallax image still has certain noise due to mismatching and the like after three-dimensional matching, and needs to be subjected to post-processing such as left and right consistency check, median filtering and hole filling, wherein the left and right consistency check is to change left and right views, the three-dimensional matching is performed again, the pixels with the offset distance exceeding the limit before and after the check are regarded as mismatching, the pixels are deleted, the median filtering is used for removing the noise points, smoothing the parallax image and filling the holes, and the missing holes are filled;
s5, performing post-processing on the parallax map to obtain a smooth parallax map;
S6, mapping the parallax image into a three-dimensional space according to a triangle principle to form a point cloud, then processing the next pair of images to obtain the point cloud, registering the point cloud with the last pair of image point clouds to obtain a fused point cloud, and after the second group of point clouds are generated, because of error reasons, the generated point clouds have offset with a certain distance, registering the two point clouds, fusing the two point clouds into one point cloud, and fusing the two point clouds into a nearest neighbor iterative algorithm;
S7, applying pressure parallel to the section of the tooth to the side surface of the target tooth, applying pressure to the two sides of the tooth when the pressure is not more than 2N, repeating the steps to obtain a tooth three-dimensional model after the pressure is applied, comparing the two tooth models, calculating the time of a displacement field of the two tooth models to be 4 seconds, finding out a position with obvious displacement, namely a position where a crack is located, repeating the steps until all pictures finish calculation, obtaining preliminary tooth three-dimensional point cloud data at the moment, and after obtaining a point cloud picture, carrying out post-processing on the point cloud picture, wherein the post-processing comprises filtering to remove outliers, filling cavities and the like, carrying out curved surface reconstruction on the point cloud to obtain a three-dimensional model, and adopting a Poisson reconstruction method for curved surface reconstruction;
And S8, comparing the two point clouds obtained in the step S7, calculating according to a 3D-DIC method to obtain a displacement field, and further calculating to obtain a strain field. Finally analyzing the strain field to obtain the position of the main crack, comparing the tooth three-dimensional models before and after stress deformation, matching the points with higher correlation degree through a three-dimensional digital image correlation method (3D-DIC), calculating to obtain displacement information and strain information of the point pairs, and obtaining the three-dimensional strain field of the whole tooth after matching all points in the point cloud set is completed
And S9, finding the position with the largest strain in the three-dimensional strain field by utilizing the characteristic that the crack area is more sensitive to pressure, namely, the position where the crack is located, firstly setting a threshold value according to the principle, eliminating the interference of the tiny crack branches on the main crack, then setting a search step length, and extracting the high-strain area in the three-dimensional strain field, namely, the area where the crack is located through iteration.
The key point of the embodiment of the invention is that the parallax image is obtained by extracting the tooth area in the image and performing stereo matching on the left and right views, and the parallax image is subjected to post-processing, so that the searching range can be reduced, and the computing resource consumption is reduced.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.