Summary of the invention
The purpose of the present invention is to provide the quick precise phase matching process for three-dimensional measurement, to solve to be based on phaseMethod of the matching for global search or polarity equation be time-consuming and problem that precision is low.
In order to solve the above-mentioned technical problem, the technical scheme is that providing a kind of quick essence for three-dimensional measurementTrue phase matching method, comprising: obtain accurate target area;Using weighted interpolation method, three-dimensional school is carried out to left and right phaseJust, the parallax of sub-pix is obtained;Flash removed and isolated point are removed using parallax filter;Using Gaussian filter to three-dimensional reconstructionSurface is smoothed.
Further, accurate target area is obtained using four-stepped switching policy.
Further, after three-dimensional correction, two row images of left and right are parallel to pole outside line, one, the constituency point in the phase diagram of the left side(xL,yL), the point of corresponding the right phase diagram is (xR,yR), yREqual to yLIf the phase value on the left side isIt is correspondingThe right phase value meet equationIt obtains key point (i, j) and (i+1, j), it is horizontalCoordinate isThe key point is used around pointIn two factors of coordinates computed are as follows:
Ordinate is accordingly
Sub-pix parallax is
Para_x=xR-i′;Para_y=yR-j
Further, judge isolated point with one 5 × 5 template, selected from effective subject area point (i,J), pixel ((i-2, j-2), (i-1, j-2) ... (i+1, j+2), (i+2, j+2)) determines the characteristic of point (i, j), such as fruit dot((i+m, j+n)) is that effectively, aggregate-value increases by 1, then accumulates to effective parallaxes of these points, obtains being averaged for parallaxValue, if aggregate-value is greater than 10, and the difference between the parallax and average value of institute's reconnaissance then retains the point less than 2, and otherwise deleting shouldPoint;Parallax is eliminated using linear interpolation, spacing is extracted, parallax line is divided into different parts, when section length is less than 10,Using linear interpolation method, it is assumed that cross-sectional length n, the value of two endpoints are para (0) and para (n-1), the view at this intervalDifference is defined as:
By aforesaid operations, burr and isolated point on parallax are removed.
Further, a cloud is smoothed using Gaussian filter, obtains matched line being divided into differenceThe section of section is used from three directions having a size of 5 pixels, the one-dimensional Gauss that standard deviation is 0.8 pixel in each intervalFilter.
Provided by the present invention for the quick precise phase matching process of three-dimensional measurement, reconstruction can be quickly and accurately obtainedRegion and point cloud, have preferable precision to the measurement of complex target.
Specific embodiment
The quick precise phase proposed by the present invention for three-dimensional measurement is matched below in conjunction with the drawings and specific embodimentsMethod is described in further detail.According to following explanation and claims, advantages and features of the invention will be become apparent from.It needsBright, attached drawing is all made of very simplified form and using non-accurate ratio, only conveniently, lucidly to aid in illustratingThe purpose of the embodiment of the present invention.
Core of the invention thought is, provided by the present invention for the quick precise phase matching process of three-dimensional measurement,Reconstruction regions and point cloud can be quickly and accurately obtained, there is preferable precision to the measurement of complex target.
Fig. 1 is that the process step of the quick precise phase matching process provided in an embodiment of the present invention for three-dimensional measurement showsIt is intended to.Referring to Fig.1, a kind of quick precise phase matching process for three-dimensional measurement is provided, comprising the following steps:
S11, accurate target area is obtained;
S12, the parallax of sub-pix is obtained to left and right phase progress three-dimensional correction using weighted interpolation method;
S13, flash removed and isolated point are removed using parallax filter;
S14, it is smoothed using surface of the Gaussian filter to three-dimensional reconstruction.
Using four-stepped switching policy, the intensity of stripe pattern is
I1(x, y)=Ia(x,y)+Im(x,y)cos(φ(x,y))
I2(x, y)=Ia(x,y)+Im(x,y)cos(φ(x,y)+π/2)
I3(x, y)=Ia(x,y)+Im(x,y)cos(φ(x,y)+π)
I4(x, y)=Ia(x,y)+Im(x,y)cos(φ(x,y)+3π/2) (1)
Ia(x, y) indicates the intensity of environment light, Im(x, y) indicates modulate intensity, and φ (x, y) is expansion phase, from formula(1) in, Ia(x, y) and Im(x, y) can be described as:
Ia(x, y)=(I1+I2+I3+I4)/4
Im(x, y)=(((I4-I2)^2+(I1-I3)^2)^0.5)/2 (2)
Co-occurrence matrix is defined asCijIt indicates in ImIn there is i value and in IaIn have jThe sum of all pixels of value, PijIt is probability value.Fig. 2 is the co-occurrence matrix provided in an embodiment of the present invention based on environment light modulation.ReferenceFig. 2, (s, t) are the threshold values (R1, R2, R3 and R4) that matrix is divided into four quadrants.In biggish modulation and environment illumination intensityUnder, phase value is more accurate.In order to obtain optimal threshold, we it is ensured that equation (4) minimum value.
QR1,QR2,QR3And QR4It is defined as follows:
QR1(s, t)=PR1/(s+1)(t+1)0≤i≤s,0≤j≤t
QR2(s, t)=PR2/(t+1)(L1-s-1)s+1≤i≤L1-1,0≤j≤t
QR3(s, t)=PR3/(L2-t-1)(s+1)0≤i≤s,t+1≤j≤L2-1
QR4(s, t)=PR2/(L1-s-1)(L2-t-1)s+1≤i≤L1-1,t+1≤j≤L2-1 (5)
When threshold value (s, t) is sought, a symbiosis mask can establish for image segmentation.
OTSU algorithm is applied in intensity image IaIntensity mask value Mask is obtained in (x, y)ia.If co-occurrence matrix and intensityMask is true, then subject area is effective.Fig. 2 a is the image of the candy strip of camera provided in an embodiment of the present invention shooting;Figure2b is the package phase provided in an embodiment of the present invention obtained using four-stepped switching policy.Fig. 2 c is intensity provided in an embodiment of the present inventionImage.Referring to Fig. 2 c, the intensity image shown in figure can be calculated with equation (2);Fig. 2 d is provided in an embodiment of the present invention totalExisting mask.It can be obtained by equation (6) referring to Fig. 2 d co-occurrence mask;Fig. 2 e is intensity mask provided in an embodiment of the present invention.Referring to Fig. 2 e, intensity mask is obtained using OTSU method on intensity image;Fig. 2 f is segmentation provided in an embodiment of the present inventionThe advantages of foreground area, reference Fig. 2 f, this method combines two kinds of masks, provide an accurate target area.
After three-dimensional correction, two row images of left and right are parallel to pole outside line.When we choose a point in the phase diagram of the left side(xL,yL), the point of corresponding the right phase diagram is (xR,yR).Because of the reason of three-dimensional correction, yREqual to yL.In this case,yRIt is to fix a pixel.Fig. 3 is provided in an embodiment of the present invention for obtaining the template of subpixel coordinates.Referring to shown in Fig. 3,If the phase value on the left side isCorresponding the right phase value meets equation (7),
Based on this equation, our available key points (i, j) and (i+1, j).Corresponding abscissa can be asked by formula (8)?.
The point that surround based on key point can be used for coordinates computed.The two factors are defined as:
Corresponding ordinate can be obtained by equation (11).
Sub-pix parallax can be obtained by equation (12)
Para_x=xR-i′;Para_y=yR-j (12)
Filtering parallax, there are two steps.One is removal isolated points, and another kind is smooth disparity.Firstly, we are with one 5× 5 template judges isolated point.A point (i, j) is selected from effective subject area.Pixel ((i-2, j-2), (i-1, j-2) ... (i+1, j+2), (i+2, j+2)) determine the characteristic of point (i, j).If fruit dot ((i+m, j+n)) is effectively, to add upValue increases by 1.Then effective parallax of these points is accumulated.The average value of our available parallaxes.If aggregate-value is bigDifference in 10, and between the parallax and average value of institute's reconnaissance then retains the point, otherwise deletes the point less than 2.Second, using lineProperty interpolation eliminates parallax.Spacing is extracted, parallax line is divided into different parts.When section length is less than 10, using lineProperty interpolation method.Assuming that cross-sectional length is n, the value of two endpoints is para (0) and para (n-1).The parallax value at this interval canWith is defined as:
By this operation, the burr and isolated point on parallax are removed.
After obtaining accurate parallax, three-dimensional point cloud can be calculated by calibrating parameters.Using Gaussian filter pairPoint cloud is smoothed.The section that matched line is divided into different sections is obtained.In each interval, make from three directionsWith having a size of 5 pixels, the one-dimensional Gaussian filter that standard deviation is 0.8 pixel.After that, the surface for putting cloud is more smooth.
A kind of quick fine matching method based on absolute phase figure provided by the invention.Object mask can reduce reconstructionNoise spot and runing time.A kind of new weighted interpolation method introduces accurate sub-pix view in abscissa and ordinateDifference.Flash removed and isolated point are removed using parallax and point cloud filter, obtains accurate surface.Measurement of this method to complex targetWith preferable precision.
Obviously, those skilled in the art can carry out various changes and deformation without departing from essence of the invention to the present inventionMind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologiesWithin, then the present invention is also intended to include these modifications and variations.