Background
The method for measuring the three-dimensional morphology of the scene to be measured based on the image focusing information generally has the advantages of low dependence on hardware equipment, easiness in paralleling of a three-dimensional reconstruction algorithm, strong transportability of a reconstruction system and the like, and is widely applied to the fields of part defect detection in the field of micro-manufacturing, intelligent zooming of mobile imaging equipment and the like.
At present, the three-dimensional shape reconstruction method based on image focusing information mainly focuses on two aspects of design of image focusing evaluation indexes and construction of shape reconstruction algorithms. The image focusing evaluation index is used as a core link of a three-dimensional shape reconstruction method, the accuracy of extracting image focusing information directly determines the quality of a three-dimensional reconstruction result, typical image focusing evaluation indexes can be divided into a space domain and a frequency domain, wherein the space domain method mainly utilizes a time domain transformation method to determine whether a current pixel point is in a focusing area range from the aspect of an image pixel, then obtains the three-dimensional shape reconstruction result of a scene to be detected by aggregating position information of all focusing pixels, and the indexes can be roughly divided into three categories of Laplace transformation, gradient transformation and statistic estimation; the frequency domain method firstly transforms the image into high and low frequency components, and then obtains a three-dimensional shape reconstruction result by mining the incidence relation between the high and low frequency components and the depth image, and the method mainly comprises two major types of Fourier transform and wavelet transform. The shape reconstruction algorithm is mainly used for overcoming the discontinuous influence on a reconstruction result caused by the sampling interval of an image sequence, and a main representative method is Gaussian fitting.
By understanding the current state of the art, we believe that this field approach is mainly challenged by: the existing three-dimensional shape reconstruction method can only carry out three-dimensional reconstruction on a single scene generally and cannot be applied to three-dimensional reconstruction tasks of other scenes, namely, the quality of the three-dimensional shape reconstruction effect of different scenes depends on the accuracy of image focusing evaluation index selection in the three-dimensional shape reconstruction method. Therefore, how to provide a scene adaptive image focusing evaluation index is an important problem in the field of three-dimensional topography reconstruction.
In summary, how to select an image focus evaluation index according to the image characteristics in the scene is considered as a key for solving the above problem. The method includes the steps that non-down-sampling shear wave transformation is introduced to overcome the problem of singleness of focusing evaluation indexes of a traditional three-dimensional shape reconstruction method, a plurality of image focusing evaluation indexes covering any direction and scale in an image can be obtained through the non-down-sampling shear wave transformation, a plurality of depth images with different scales and directions are obtained based on the evaluation indexes, and then a depth image texture feature-based clustering method is provided to obtain an optimal three-dimensional reconstruction result representing a scene to be measured.
Disclosure of Invention
In order to overcome the problems in the prior art, the invention aims to provide a three-dimensional shape reconstruction method based on non-downsampling shear wave transformation and depth image texture feature clustering.
The technical scheme adopted by the invention is as follows: a three-dimensional shape reconstruction method based on non-down-sampling shear wave transformation and depth image texture feature clustering comprises the following steps:
step 1, adjusting the distance between a camera and a scene to be detected at equal intervals to obtain image sequences of different depths of field of the scene to be detected
Wherein i represents the number of images, the numeric range of i is more than or equal to 1 and less than or equal to N, and (x, y) represents the coordinate position of the image sequence, the range of x is more than or equal to 0, and y is more than or equal to M-1;
step 2, setting the maximum decomposition scale of non-down-sampling shear wave transformation as J, setting the maximum direction number as L, setting a filter of non-down-sampling shear wave transformation, setting the clustering number K in a clustering algorithm, and setting the distance measurement standard as Euclidean distance;
step 3, the image sequence in the
step 1 is processed
Performing non-downsampling shear wave transformation (NSST), wherein each image can obtain J × L high-frequency decomposition coefficients with different scales and directions as shown in formula (1);
wherein J represents the number of the ruler and the range of J is more than or equal to 1 and less than or equal to J, L represents the number of the direction and the range of L is more than or equal to 1 and less than or equal to L,
high-frequency decomposition coefficient of the ith image in the dimension j and the direction l, and high-frequency coefficient
The subscript of (A) has a value range of 1-ihigh-N, and NSST represents non-down-sampling shear wave transformation;
step 4, according to the formula (2), J multiplied by L high-frequency coefficients with different scales and directions
Depth image mapped into J × L different scales and directions
Wherein ihigh indicates that the value range of the ihigh high-frequency coefficient corresponding to the ith image is more than or equal to 1 and less than or equal to N,
a function for solving the high-frequency coefficient subscript ihigh is shown, and abs (·) represents an absolute value function;
step 5, calculating each depth image
And the contrast r of the gray level co-occurrence matrix is expressed according to the formula (3)
ConCorrelation r
CorEnergy r
EneInverse variance r
HomAnd entropy r
EntJ multiplied by L depth images are used as five-dimensional feature vectors of the depth images to obtain J multiplied by L five-dimensional feature vectors;
wherein GLCM (-) represents a computation function of the gray level co-occurrence matrix, Vj,l() a feature vector representing the depth image at the jth dimension in the direction of l;
step 6, clustering the JXL five-dimensional feature vectors obtained in the step 5 according to a K-means clustering algorithm of the formula (4) to obtain K clustering results { C1,C2,…,CK};
Where Kmeans (-) represents the K-means clustering algorithm, class C
1Is totally composed of
Individual depth image set
By analogy, class C
KIs totally composed of
Individual depth image set
Step 7, calculating the average gradient in all the depth image classes obtained in the step 6, and selecting the class C with the minimum average gradient according to the formula (5)sAs a final depth image class;
wherein
Representing a function for solving the subscript m of the depth image class, wherein the value range of m is more than or equal to 1 and less than or equal to K, Gradient () is a Gradient function, and s is the serial number of the minimum class of the average Gradient;
step 8, calculating the minimum class C of the average gradient obtained in the step 7 according to the formula (6)
sAll ofThe average value of the images is used for obtaining the final three-dimensional shape reconstruction result of the scene to be measured
Wherein
Is the mean gradient minimum class C
sThe number of medium depth images.
The method can obtain the optimal three-dimensional shape reconstruction result suitable for the scene according to different scenes to be detected.
Detailed Description
As shown in fig. 1 and fig. 2, the three-dimensional feature reconstruction method based on non-downsampling shear wave transformation and depth image texture feature clustering in this embodiment includes the following steps:
step 1, adjusting the distance between a camera and a scene to be detected at equal intervals to obtain image sequences of different depths of field of the scene to be detected
Wherein i represents the number of images, the numeric range of i is more than or equal to 1 and less than or equal to N, and (x, y) represents the coordinate position of the image sequence, the range of x is more than or equal to 0, and y is more than or equal to M-1;
step 2, setting the maximum decomposition scale of non-down-sampling shear wave transformation as J, setting the maximum direction number as L, setting a filter of non-down-sampling shear wave transformation, setting the clustering number K in a clustering algorithm, and setting the distance measurement standard as Euclidean distance;
step 3, the image sequence in the
step 1 is processed
Performing non-downsampling shear wave transformation (NSST), wherein each image can obtain J × L high-frequency decomposition coefficients with different scales and directions as shown in formula (1);
wherein J represents the number of the ruler and the range of J is more than or equal to 1 and less than or equal to J, L represents the number of the direction and the range of L is more than or equal to 1 and less than or equal to L,
high-frequency decomposition coefficient of the ith image in the dimension j and the direction l, and high-frequency coefficient
The subscript of (A) has a value range of 1-ihigh-N, and NSST represents non-down-sampling shear wave transformation;
step 4, according to the formula (2), J multiplied by L high-frequency coefficients with different scales and directions
Depth image mapped into J × L different scales and directions
Wherein ihigh indicates that the value range of the ihigh high-frequency coefficient corresponding to the ith image is more than or equal to 1 and less than or equal to N,
a function for solving the high-frequency coefficient subscript ihigh is shown, and abs (·) represents an absolute value function;
step 5, calculating each depth image
And the contrast r of the gray level co-occurrence matrix is expressed according to the formula (3)
ConCorrelation r
CorEnergy r
EneInverse variance r
HomAnd entropy r
EntJ multiplied by L depth images are used as five-dimensional feature vectors of the depth images to obtain J multiplied by L five-dimensional feature vectors;
wherein GLCM (-) represents a computation function of the gray level co-occurrence matrix, Vj,l() a feature vector representing the depth image at the jth dimension in the direction of l;
step 6, clustering the JXL five-dimensional feature vectors obtained in the step 5 according to a K-means clustering algorithm of the formula (4) to obtain K clustering results { C1,C2,…,CK};
Where Kmeans (-) represents the K-means clustering algorithm, class C
1Is totally composed of
Individual depth image set
By analogy, class C
KIs totally composed of
Individual depth image set
Step 7, calculating the average gradient in all the depth image classes obtained in the step 6, and selecting the class C with the minimum average gradient according to the formula (5)sAs a final depth image class;
wherein
Representing a function for solving the subscript m of the depth image class, wherein the value range of m is more than or equal to 1 and less than or equal to K, Gradient () is a Gradient function, and s is the serial number of the minimum class of the average Gradient;
step 8, calculating the minimum class C of the average gradient obtained in the step 7 according to the formula (6)
sAverage value of all the images in the image to obtain the final three-dimensional shape reconstruction result of the scene to be measured
Wherein
Is the mean gradient minimum class C
sThe number of medium depth images.