Summary of the invention
Technical matters:, the objective of the invention is to not influence the influence of eliminating the spectral aliasing in the Fourier transform three-dimensional measurement method under the prerequisite of measuring real-time and the precision that improves the phase unwrapping process to the spectral aliasing and the not high problem of phase unwrapping process robustness that exist in the Fourier transform three-dimensional measurement method.This method only needs projection one amplitude grating image, has improved measured real-time property, can realize kinetic measurement, and can overcome factors such as testee surface reflectivity difference and surface noise, reaches measuring accuracy preferably, has robustness preferably.
Technical scheme: a kind of measuring three-dimensional morphology method based on tricolor grating projection and Fourier transform, concrete steps are following:
Step 1: design a width of cloth colour projection raster image, and raster image is projected to the object under test surface, said colour projection raster image is provided with as follows:
f(m,n)=a
r+b
rcos(2πf
0m)+a
g+b
gcos(4πf
0m)+a
b
Wherein, a
r, a
gBe R, the background light intensity of G component, b
r, b
gBe R, the reflectivity of G component, a
bBe set to R, the mean value of G two components, f
0Be the frequency of R component sine streak, (frequency of G component sine streak is 2 times of R component sine streak for m, the n) two-dimensional coordinate of representation raster image,
Step 2: use colored CCD that body surface to be measured is taken, obtain an amplitude variation shape grating fringe image:
g(x,y)=r
r(x,y)[a
r+b
rcos(2πf
0x+φ
1(x,y))]+
r
g(x,y)[a
g+b
gcos(4πf
0x+φ
2(x,y))]+r
b(x,y)a
b
Wherein, r
r(x, y), r
b(x, y), r
g(x, y) be object to different colours reflection of light rate, reflectivity is a constant, φ
1(x, y), φ
2(x y) is the PHASE DISTRIBUTION of low frequency and high frequency to be asked, (and x, the y) two-dimensional coordinate of expression deformed grating stripe pattern,
Step 3: from the deformed grating stripe pattern, separate R, G, the B component of the coloured image obtain, and from R, G component gray-scale map, remove background component, obtain removing the R component low frequency standard grayscale figure R after the background component
1(x, y), remove the G component high frequency standard grayscale figure G after the background component
1(x, y),
Adopt following method from R component gray-scale map, to remove background component:
Step 3.1.1: the mean value m that at first asks for R component pixel gray-scale value
rWith variance d
r, the mean value m of B component pixel gray-scale value
bWith variance d
bUse following formula to revise each grey scale pixel value of R component:
r
1(x,y)=r(x,y)+m
b-m
r
Wherein (x y) is the R component intensity profile after proofreading and correct, r to R
1(x y) is intermediate variable,
Be r
1(x, mean value y),
Contain the sinusoidal phase modulation signal R component of object height information after obtaining proofreading and correct and represent the B component of background component can be expressed as as follows:
R(x,y)=a(x,y)+b(x,y)cos[2πf
0x+φ
1(x,y)];
B(x,y)=a(x,y);
Step 3.1.2: to R (x, y), ((x, y) (x y) deducts in two kinds of components B, is not contained the grey-scale raster images R of background and high fdrequency component from R with B then for x, y) filtering
1(x, y):
R
1(x,y)=R(x,y)-B(x,y)
=b(x,y)cos[2πf
0x+φ
1(x,y)];
Adopt following method from G component gray-scale map, to remove background component:
Step 3.2.1: the mean value m that at first asks for G component pixel gray-scale value
gWith variance d
g, the mean value m of B component pixel gray-scale value
bWith variance d
bUse following formula to revise each grey scale pixel value of G component:
g
1(x,y)=g(x,y)+m
b-m
g
Wherein (x y) is the G component intensity profile after proofreading and correct, g to G
1(x y) is intermediate variable,
Be g
1(x, mean value y),
Obtaining proofreading and correct the back representative contains the double frequency sinusoidal phase modulation signal G component of object height information and represents the B component of background component can be expressed as as follows:
G(x,y)=a(x,y)+b(x,y)cos[2πf
0x+φ
2(x,y)];
B(x,y)=a(x,y);
Step 3.2.2: to G (x, y), ((x, y) (x y) deducts in the component B, is not contained the grey-scale raster images G of background and high fdrequency component from G with B then for x, y) filtering
1(x, y):
G
1(x,y)=R(x,y)-B(x,y)
=b(x,y)cos[2πf
0x+φ
2(x,y)]。
Step 4: to the R component low frequency standard grayscale figure R after the removal background component
1(x, y), remove the G component high frequency standard grayscale figure G after the background component
1(x y) does Fourier transform, and obtain the relative phase distribution of R component and the relative phase of G component respectively and distribute,
To low frequency standard grayscale figure R
1(x y) does Fourier transform, and it is following to obtain the process that the relative phase of R component distributes:
Step 4.1.1: with R
1(x y) is expressed as exponential form:
Wherein, when n=0, A
n=0,
Expression imaginary unit,
Step 4.1.2: looking y is constant, adopts 1 dimension fast fourier transform algorithm to low frequency standard grayscale figure R
1(x, every row y) carries out Fourier transform, and conversion process is:
The expression formula that obtains frequency domain is:
Wherein, Q
n(f-nf
0, y) be A
nr
r(x, y) exp [in φ
1(x, y)] accordingly in the expression formula of frequency domain, f representes the variable of frequency domain,
Step 4.1.3: to Q
n(f-nf
0, y) carry out filtering and extract Q
1(f-f
0, y), again to Q
1(f-f
0, y) carry out inverse Fourier transform, obtain containing the A of phase information
1r
r(x, y) exp [i φ
1(x, y)], calculate A
1r
r(x, y) exp [i φ
1(x, y)] angle value can obtain containing the R component relative phase value φ of object height information
1(x, y), the phase value that obtains is between 0-2 π;
To high frequency standard grayscale figure G
1(x y) does Fourier transform, and it is following to obtain the process that the relative phase of G component distributes:
Step 4.2.1: with G
1(x y) is expressed as exponential form:
Wherein, when n=0, B
n=0,
Expression imaginary unit,
Step 4.2.2: looking y is constant, adopts 1 dimension fast fourier transform algorithm to low frequency standard grayscale figure R
1(x, every row y) carries out Fourier transform, and conversion process is:
The expression formula that obtains frequency domain is:
Wherein, P
n(f-nf
0, y) be B
nr
g(x, y) exp [in φ
1(x, y)] accordingly in the expression formula of frequency domain, f representes the variable of frequency domain,
Step 4.2.3: to P
n(f-nf
0, y) carry out filtering and extract P
1(f-f
0, y), again to P
1(f-f
0, y) carry out inverse Fourier transform, obtain containing the B of phase information
1r
g(x, y) exp [i φ
2(x, y)], calculate B
1r
g(x, y) exp [i φ
2(x, y)] angle value can obtain containing the G component relative phase value φ of object height information
2(x, y), the phase value that obtains is between 0-2 π;
Step 5:
Step 5.1: the relative phase value φ that adopts the R component that obtains in the direct deployment step 4 of scanning Beam Method
1(x, y) promptly through following formula point by point scanning, in PHASE DISTRIBUTION, do not have till the saltus step greater than π:
Wherein,
Be the low frequency absolute phase after launching, φ
1(x y) is relative phase, Δ φ
1Be the phase difference value between adjacent 2,
Step 5.2: the relative phase value φ that adopts the G component that obtains in the direct deployment step 4 of scanning Beam Method
2(x, y) promptly through following formula point by point scanning, in PHASE DISTRIBUTION, do not have till the saltus step greater than π:
Wherein,
Be the high frequency absolute phase after launching, φ
2(x y) is relative phase, Δ φ
2Be the phase difference value between adjacent 2
Step 6: calculate and accurately launch phase value,
Step 6.1: Read to get the low-frequency absolute phase
and high absolute phase
Step 6.2: traversal
is calculated difference degree between the two, promptly obtains following parameter distributions:
Ceil representes the function that rounds up in the following formula,
If Q ≠ 0; Then use Q that high frequency absolute phase
is proofreaied and correct, that is:
is the accurate expansion phase value that obtains.
Step 7: read final expansion phase result
according to classical optical grating projection by launching phase result
to object height h (x; Y) conversion formula; Finally try to achieve the three-dimensional information of Measuring Object, described conversion formula is:
Wherein, l, d are the geometric parameters of measuring system, and l is the distance of projector to measurement plane, and d is the distance of CCD camera to projector,
The expression phase changing capacity,
Be the expansion phase result,
Be initial phase result, ω
0Angular frequency for projection grating.
Beneficial effect: compared with prior art; The present invention has following advantage: at first; Make full use of the RGB3 kind component of coloured image, the sinusoidal grating of two kinds of frequencies is enrolled two kinds of components of RG, the B component is set to the mean value of RG component; Greatly reduce the number of the required projection grating image of three-dimensional measurement, improved measuring speed.Because the present invention only needs projection one amplitude grating image, can realize the quick measurement to dynamic object.Secondly; Fourier transform three-dimensional measurement method than the projection of Traditional use gray level image; The present invention is owing to use the B component to be set to the mean value of RG component in projection grating; When deformed grating is handled, can when the RG component is done Fourier transform, suppress 0 frequency component, reduce the influence of spectral aliasing measuring accuracy through separating 0 frequency component that the B component obtains RG component gray level image.At last; In the phase unwrapping process; The present invention adopts and represents the RG component relative phase value of height frequency to launch method of correcting then respectively, compares traditional scanning line method, can avoid since object contain big height saltus step and noise generation separate phase error and propagation of error phenomenon.To sum up, the present invention can realize the three-dimensional information of dynamic object is measured fast and accurately, obtains accurate absolute phase distribution plan, has good real-time performance and accuracy.
Embodiment
Further specify below in conjunction with the accompanying drawing specific embodiments of the invention.Under windows operating system, select for use VC++6.0, the deformed grating image that CCD collects is handled as programming tool.This instance adopts the motorcycle backplate as testee, finally obtains the more accurate whole audience absolute phase that contains the backplate three-dimensional information and distributes.
Fig. 1 is the process flow diagram of whole process of the present invention.
Fig. 2 is the three-dimension measuring system that the present invention adopts.With projector the tricolor grating image projection is arrived testee, adopt colored CCD to gather the deformed grating image, transfer in the computing machine through graph card and handle.
Fig. 3 is the process flow diagram that step 3 of the present invention is separated 3 kinds of components of images acquired and removal background.
Fig. 4 is that step 6 of the present invention adopts dual-frequency method correction absolute phase to obtain the process flow diagram of precise phase value.
The present invention utilizes three kinds of components of RGB of coloured image to solve spectral aliasing and the Phase unwrapping that exists in the Fourier transform mensuration.With two kinds of components of sinusoidal variations rule modulation RG of two kinds of frequencies, the B component is set to the mean value of the gray scale of R, G component, forms a color image frame and projects body surface.Use CCD to gather the deformed grating image that receives the modulation of testee height.Through separating 3 kinds of components in this image, B component gray level image is deducted from RG component gray level image respectively, adopt Fourier transform analysis to find the solution then and obtain two kinds of relative phase values under the frequency.Phase unwrapping is carried out in distribution to relative phase, at first adopts scanning line method to launch the high and low frequency absolute phase respectively, proofreaies and correct the high frequency absolute phase to eliminate error with the low frequency absolute phase then, obtains the higher whole audience absolute phase values of precision.Then according to the phase place of classical optical grating projection to the height conversion formula, finally obtain the three-dimensional information of Measuring Object.
The present invention is based on the Fourier transform three-dimensional measurement method of three coloured light projections, detailed step is following:
Step 1: design a width of cloth colour projection raster image, and raster image is projected to the object under test surface, said colour projection raster image is provided with as follows:
f(m,n)=a
r+b
rcos(2πf
0m)+a
g+b
gcos(4πf
0m)+a
b
Wherein, a
r, a
gBe R, the background light intensity of G component, b
r, b
gBe R, the reflectivity of G component, a
bBe set to R, the mean value of G two components, f
0Be the frequency of R component sine streak, (frequency of G component sine streak is 2 times of R component sine streak for m, the n) two-dimensional coordinate of representation raster image.
Step 2: use colored CCD that body surface to be measured is taken, obtain an amplitude variation shape grating fringe image:
g(x,y)=r
r(x,y)[a
r+b
rcos(2πf
0x+φ
1(x,y))]+
r
g(x,y)[a
g+b
gcos(4πf
0x+φ
2(x,y))]+r
b(x,y)a
b
Wherein, r
r(x, y), r
b(x, y), r
g(x is that object is to different colours reflection of light rate, φ y)
1(x, y), φ
2(x y) is the PHASE DISTRIBUTION of low frequency and high frequency to be asked, (and x, the y) two-dimensional coordinate of expression deformed grating stripe pattern,
Because surround lighting is constant, so can be with reflectivity r
r(x, y), r
b(x, y), r
g(x y) is regarded as constant.
Practical distortion grating fringe image is shown in Fig. 5 (a).
Step 3: from the deformed grating stripe pattern, separate R, G, the B component of the coloured image that obtains, and from R, G component gray-scale map, remove background component, obtain low frequency standard grayscale figure R
1(x, y), high frequency standard grayscale figure G
1(x, y),
3 kinds of components of RGB in the deformed grating image that receives testee height modulation that CCD is collected separate; Because object is different to the reflectivity of every kind of component of RGB; So need the value of averaging with variance correction make every kind of component background component contrast identical so that do further processing.With the B component is benchmark, with the mean value of G component and R component and contrast correction to identical with the B component.
Adopt following method from R component gray-scale map, to remove background component:
Step 3.1.1: the mean value m that at first asks for R component pixel gray-scale value
rWith variance d
r, the mean value m of B component pixel gray-scale value
bWith variance d
bUse following formula to revise each grey scale pixel value of R component:
r
1(x,y)=r(x,y)+m
b-m
r
Wherein (x y) is the R component intensity profile after proofreading and correct, r to R
1(x y) is intermediate variable,
Be r
1(x, mean value y),
Contain the sinusoidal phase modulation signal R component of object height information after obtaining proofreading and correct and represent the B component of background component can be expressed as as follows:
R(x,y)=a(x,y)+b(x,y)cos[2πf
0x+φ
1(x,y)];
B(x,y)=a(x,y);
Step 3.1.2: to R (x, y), ((x, y) (x y) deducts in two kinds of components B, is not contained the grey-scale raster images R of background and high fdrequency component from R with B then for x, y) filtering
1(x, y):
R
1(x,y)=R(x,y)-B(x,y)
=b(x,y)cos[2πf
0x+φ
1(x,y)];
Adopt following method from G component gray-scale map, to remove background component:
Step 3.2.1: the mean value m that at first asks for G component pixel gray-scale value
gWith variance d
g, the mean value m of B component pixel gray-scale value
bWith variance d
bUse following formula to revise each grey scale pixel value of G component:
g
1(x,y)=g(x,y)+m
b-m
g
Wherein (x y) is the G component intensity profile after proofreading and correct, g to G
1(x y) is intermediate variable,
Be g
1(x, mean value y),
Obtaining proofreading and correct the back representative contains the double frequency sinusoidal phase modulation signal G component of object height information and represents the B component of background component can be expressed as as follows:
G(x,y)=a(x,y)+b(x,y)cos[2πf
0x+φ
2(x,y)];
B(x,y)=a(x,y);
Step 3.2.2: to G (x, y), ((x, y) (x y) deducts in the component B, is not contained the grey-scale raster images G of background and high fdrequency component from G with B then for x, y) filtering
1(x, y):
G
1(x,y)=R(x,y)-B(x,y)
=b(x,y)cos[2πf
0x+φ
2(x,y)]°
Actual high frequency standard grayscale figure G
1(x, y), low frequency standard grayscale figure R
1(x, y) as Fig. 5 (b) (c) shown in.Fig. 5 (d) for the B of representative background component (x, y).Fig. 6 (a) is that (x, y) the 400th line frequency spectrum are that (x, y) the 400th line frequency spectrum (before unfiltered) (c) is low frequency standard grayscale figure R to the B component image B that represents background component (b) to R component image R before subtracting each other
1(x, y) the 400th line frequency spectrum (d) is high frequency standard grayscale figure G
1(x, y) the 400th line frequency spectrum.Can find out by spectrogram, through the processing of step 3, low frequency standard grayscale figure R
1(x, y) the 400th line frequency spectrum and high frequency standard grayscale figure G
1(x, y) background component (i.e. near frequency component 0 frequency) is suppressed fully in the 400th line frequency spectrum.
Step 4: to low frequency standard grayscale figure R
1(x, y), high frequency standard grayscale figure G
1(x y) does Fourier transform, and obtain the relative phase distribution of R component and the relative phase of G component respectively and distribute,
To low frequency standard grayscale figure R
1(x y) does Fourier transform, and it is following to obtain the process that the relative phase of R component distributes:
Step 4.1.1: with R
1(x y) is expressed as exponential form:
Wherein, when n=0, A
n=0,
Expression imaginary unit,
Step 4.1.2: looking y is constant, adopts 1 dimension fast fourier transform algorithm to low frequency standard grayscale figure R
1(x, every row y) carries out Fourier transform, and conversion process is:
The expression formula that obtains frequency domain is:
Wherein, Q
n(f-nf
0, y) be A
nr
r(x, y) exp [in φ
1(x, y)] accordingly in the expression formula of frequency domain, f representes the variable of frequency domain,
Step 4.1.3: to Q
n(f-nf
0, y) carry out filtering and extract Q
1(f-f
0, y), again to Q
1(f-f
0, y) carry out inverse Fourier transform, obtain containing the A of phase information
1r
r(x, y) exp [i φ
1(x, y)], calculate A
1r
r(x, y) exp [i φ
1(x, y)] angle value can obtain containing the R component relative phase value φ of object height information
1(x, y), the phase value that obtains is between 0-2 π;
To high frequency standard grayscale figure G
1(x y) does Fourier transform, and it is following to obtain the process that the relative phase of G component distributes:
Step 4.2.1: with G
1(x y) is expressed as exponential form:
Wherein, when n=0, B
n=0,
Expression imaginary unit,
Step 4.2.2: looking y is constant, adopts 1 dimension fast fourier transform algorithm to low frequency standard grayscale figure R
1(x, every row y) carries out Fourier transform, and conversion process is:
The expression formula that obtains frequency domain is:
Wherein, P
n(f-nf
0, y) be B
nr
g(x, y) exp [in φ
1(x, y)] accordingly in the expression formula of frequency domain, f representes the variable of frequency domain,
Step 4.2.3: to P
n(f-nf
0, y) carry out filtering and extract P
1(f-f
0, y), again to P
1(f-f
0, y) carry out inverse Fourier transform, obtain containing the B of phase information
1r
g(x, y) exp [i φ
2(x, y)], calculate B
1r
g(x, y) exp [i φ
2(x, y)] angle value can obtain containing the G component relative phase value φ of object height information
2(x, y), the phase value that obtains is between 0-2 π;
Fig. 7 is the R component relative phase value φ that obtains
1(x, y), G component relative phase value φ
2(x, relative phase figure y);
Step 5:
Step 5.1: the relative phase value φ that adopts the R component that obtains in the direct deployment step 4 of scanning Beam Method
1(x, y) promptly through following formula point by point scanning, in PHASE DISTRIBUTION, do not have till the saltus step greater than π:
Wherein,
Be the low frequency absolute phase after launching, φ
1(x y) is relative phase, Δ φ
1Be the phase difference value between adjacent 2,
Step 5.2: the relative phase value φ that adopts the G component that obtains in the direct deployment step 4 of scanning Beam Method
2(x, y) promptly through following formula point by point scanning, in PHASE DISTRIBUTION, do not have till the saltus step greater than π:
Wherein,
Be the high frequency absolute phase after launching, φ
2(x y) is relative phase, Δ φ
2Be the phase difference value between adjacent 2
Fig. 8; (a) be high frequency absolute phase
after launching; (b) be high frequency absolute phase
after launching
Step 6: by the absolute phase values under two kinds of frequencies that obtain in the step 5, adopt dual-frequency method to proofread and correct the high frequency absolute phase values, eliminate error, obtain final expansion phase result.
Adopt scanning line method in the
step 5,, can make can make mistakes in the absolute phase values subregion under the high frequency because the shade of some sheer face can block the mistake transmission of whole cycle and big noise spot.Obtain absolute phase value under the low frequency because fringe period is enough big; The phase unwrapping mistake that shade produces is able to avoid; But because striped underfrequency; Measuring accuracy is the absolute phase values as obtaining under the high frequency scarcely, so the absolute phase values
that adopts the absolute phase values
under the low frequency to proofread and correct under the high frequency can be eliminated the zone errors in
when not reducing the phase place solving precision.
Step 6.1: Read to get the low-frequency absolute phase
and high absolute phase
Step 6.2: traversal
is calculated difference degree between the two, promptly obtains following parameter distributions:
Ceil representes the function that rounds up in the following formula,
If Q ≠ 0; Then use Q that high frequency absolute phase
is proofreaied and correct, that is:
is the accurate expansion phase value that obtains.Phase diagram is as shown in Figure 9.
Step 7: read final expansion phase result
according to the phase place of classical optical grating projection to the height conversion formula, finally try to achieve the three-dimensional information of Measuring Object.
The geometric representation of measuring system is shown in figure 11; By launch phase result
to object height h (x, formula y) is following:
Wherein, l, d are the geometric parameters of measuring system, and l is the distance of projector to measurement plane, and d is the distance of CCD camera to projector,
The expression phase changing capacity,
Be the expansion phase result,
Be the initial phase result, by the decision of witness mark face, ω
0Be the angular frequency of projection grating, can get by system calibrating.
The point cloud chart of expression motorcycle backplate three-dimensional information is shown in figure 10.