matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

6
This content has been downloaded from IOPscience. Please scroll down to see the full text. Download details: IP Address: 203.199.213.130 This content was downloaded on 26/12/2013 at 13:40 Please note that terms and conditions apply. Continuous wavelet transform analysis of projected fringe patterns View the table of contents for this issue, or go to the journal homepage for more 2004 Meas. Sci. Technol. 15 1768 (http://iopscience.iop.org/0957-0233/15/9/013) Home Search Collections Journals About Contact us My IOPscience

Upload: partha-pratim-basumallick

Post on 28-Nov-2015

5 views

Category:

Documents


0 download

DESCRIPTION

matlab

TRANSCRIPT

Page 1: matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

This content has been downloaded from IOPscience. Please scroll down to see the full text.

Download details:

IP Address: 203.199.213.130

This content was downloaded on 26/12/2013 at 13:40

Please note that terms and conditions apply.

Continuous wavelet transform analysis of projected fringe patterns

View the table of contents for this issue, or go to the journal homepage for more

2004 Meas. Sci. Technol. 15 1768

(http://iopscience.iop.org/0957-0233/15/9/013)

Home Search Collections Journals About Contact us My IOPscience

Page 2: matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

INSTITUTE OF PHYSICS PUBLISHING MEASUREMENT SCIENCE AND TECHNOLOGY

Meas. Sci. Technol. 15 (2004) 1768–1772 PII: S0957-0233(04)76632-1

Continuous wavelet transform analysis ofprojected fringe patternsAli Dursun1, Serhat Ozder2 and F Necati Ecevit3

1 Department of Electronics Engineering, Gebze Institute of Technology, PO Box 141,Gebze 41400, Kocaeli, Turkey2 Department of Physics, Canakkale Onsekiz Mart University, 17100 Canakkale, Turkey3 Department of Physics, Gebze Institute of Technology, PO Box 141, Gebze 41400, Kocaeli,Turkey

E-mail: [email protected]

Received 23 February 2004, in final form 23 April 2004Published 23 July 2004Online at stacks.iop.org/MST/15/1768doi:10.1088/0957-0233/15/9/013

Abstract3D profile measurement of an object is studied experimentally by using astandard fringe projection technique consisting of a CCD camera and adigital projector. The height profile of the object is calculated through thephase change distribution of the projected fringes from the phase and phasegradient of the wavelet transform. Experimental results for the Fouriertransform profilometry algorithm are compared with the results of waveletanalysis.

Keywords: wavelet transform, fringe projection, 3D profile determination

1. Introduction

Determination of the absolute phase change distribution of anobject field from the fringe pattern is an important problemthat can find applications in, for example, interferometry andprofilometry [1–3]. There are several techniques for measuring3D surface shape which use a structured light pattern,including the moire technique [1] and Fourier transformprofilometry (FTP) [2, 3]. In the technique of Fouriertransform profilometry, a Ronchi or sinusoidal grating isprojected onto a surface. Height information from the objectis encoded into the deformed fringe pattern as a phase change,and then this fringe pattern is recorded by an image sensor. Thephase change information is obtained by Fourier transformingthe acquired image, filtering in the spatial frequency domainand then calculating the inverse transformation. To restore theoriginal object phase distribution, the ϕ(x, y) wrapped phaseof the inverse Fourier transform of the filtered fringe pattern isunwrapped with a suitable algorithm in the x and y directionsand then height information is calculated by using geometricalparameters of the setup and phase. Phase unwrapping is verysensitive to noise. Many algorithms have been proposed forsolving the phase unwrapping problem, and they differ intheir method of solution, area of application and robustness[2, 4]. As an alternative method for phase evaluation,

algorithms based on the continuous wavelet transform (CWT)have been proposed. One of the methods, in which the phasedistribution of the fringe pattern is obtained without usingany unwrapping algorithms, directly gives the phase gradientfrom the wavelet transform of the fringe pattern, which is thenintegrated to obtain the phase distribution [5, 6]. In the othermethod, the phase of the wavelet transform is calculated andunwrapped to obtain the phase distribution of fringes [7].

In this work we study in detail the application of thecontinuous wavelet transform method using Morlet waveletsfor the determination of the phase distribution of fringes andhence the three-dimensional profile of an object by the fringeprojection technique.

2. Wavelet transform method

Consider the following one-dimensional fringe signalcorresponding to any y-pixel (row) of the fringe pattern

g(x) = I0(x)[1 + V (x) cos(mx + ϕ(x))], (1)where I0(x) is the background intensity, V (x) is the visibilityof the fringe, ϕ(x) is the height-modulated phase of the fringeand m is the spatial carrier frequency in the x direction whichmust satisfy the following condition to recover the phase [2]:

m >

∣∣∣∣dφ

dx

∣∣∣∣max

. (2)

0957-0233/04/091768+05$30.00 © 2004 IOP Publishing Ltd Printed in the UK 1768

Page 3: matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

Continuous wavelet transform analysis of projected fringe patterns

0 100 200 300 400 500x-pixel

0.0

0.2

0.4

0.6

0.8

1.0

Pha

se (

rad)

(a)

0 100 200 300 400 500x-pixel

-0.015

-0.010

-0.005

0.000

0.005

0.010

0.015

Pha

se g

radi

ent

(rad

/pix

el) (b)

0 100 200 300 400 500x-pixel

0.0

0.2

0.4

0.6

0.8

1.0

Pha

se (

rad)

CWT gradientCWT phaseFTP

(c)

0 100 200 300 400 500x-pixel

-1.0

-0.5

0.0

0.5

1.0

1.5

2.0

Pha

se e

rror

(ra

d) x

10-2

CWT gradientCWT phaseFTP (d)

Figure 1. (a) Simulated phase function. (b) Gradient of simulated phase (solid line) and recovered phase gradient from the CWT gradientmethod (dashed line). (c) Recovered phases and (d) phase errors by three methods (CWT gradient: solid line, CWT phase: dashed line,FTP: square).

The one-dimensional wavelet transform of the fringe signal isdefined by [8]

W(s, b) = 1√s

∫ ∞

−∞h∗

(x − b

s

)g(x) dx

= √s

∫ ∞

−∞H ∗(sk)G(k) exp(ibk) dk. (3)

Each wavelet is obtained by scaling a mother wavelet h(x)

by s > 0 and translating it by b. The second form allows theuse of fast a Fourier transform algorithm and results in muchfaster calculations, where

√sH(sk) and G(k) are the Fourier

transforms of 1√sh(

xs

)and g(x), respectively [8, 9].

The choice of an appropriate wavelet for a givenapplication is an important practical question. In this study, theMorlet wavelet was used to deal with phase recovery becauseit is known to provide a better localization in both spatial andfrequency domains. The Morlet wavelet, which is a planewave modulated by a Gaussian, is defined as

h(x) = π1/4 exp(icx) exp(−x2/2), (4)

and its Fourier transform as

H(k) =√

2π4√

πexp

[− (k − c)2

2

], (5)

where c is a fixed spatial frequency, and chosen to be about 5or 6 to satisfy the admissibility condition [9]. It satisfies the

minimum uncertainty relation �k�x = 1/2 [10], whereas forinstance, �k�x = 1/2

√(2n + 1)/(2n − 1) for the nth-order

Paul wavelet used by Afifi et al [6]. This result is obviousbecause the Gaussian window function used in the Morletwavelet transform is the optimal window shape.

Based on the localization property of the Morlet wavelet[10], the phase of the fringe can be approximated by ϕ(x) ∼=ϕ(b)+(x−b)ϕ′(b). Furthermore, assuming a slow variation ofI0 and V, the Fourier transform of the fringe signal is evaluatedas

G(k) = I0(b)π{2δ(k) + V (b)

[δ(k − m − ϕ′(b)) ei[ϕ(b)−bϕ′(b)]

+ δ(k + m + ϕ′(b)) e−i[ϕ(b)−bϕ′(b)]]}

(6)

Then, inserting equations (5) and (6) into equation (3), andnoting that H(sk) = 0 for k � 0, we obtain

W(s, b) = I0(b)V (b)π5/4√

2s exp

[[s(m + ϕ′(b)) − c]2

2

]

× exp[i(ϕ(b) + bm)]. (7)

The modulus |W(s, b)| has a ridge at

smax(b) = c +√

c2 + 2

2(m + ϕ′(b)), (8)

which leads to the phase distribution for that row by integrationwithout using any unwrapping algorithms that are inherent inthe Fourier method and the phase-of-wavelet method.

1769

Page 4: matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

A Dursun et al

102

103

N

10-3

10-2

10-1

100

Mea

n ab

solu

te p

hase

err

or (

rad) CWT gradient

CWT phase

0

2

4

6

8

10

Com

puta

tion

tim

e (s

)

Computation time

Figure 2. Mean absolute phase error by CWT gradient and CWTphase methods and computation time versus number of scale.

In the phase-of-wavelet transform method, the wrappedphase distribution is directly acquired from the phase-of-wavelet transform φW(b) = tan−1

[ImWReW

] = ϕ(b) + bm andthe unwrapped phase ϕ is obtained by unwrapping φW usinga suitable algorithm to correct phase discontinuities.

As an example, to test the above phase recoveryalgorithms, the following one-dimensional simulated phasemodulation function was used (figure 1(a)):

ϕ(x) = c1 exp(−(x − 100)2/s1) + c2 exp(−(x − 200)2/s2)

+ c3 exp(−(x − 350)2/s3), (9)

where c1 = 0.4, c2 = 0.9, c3 = 0.7, s1 = 1000, s2 = 5000and s3 = 3000. The fringe signal corresponding to this phasefunction was calculated by taking I0 = 1.0, V (x) = 1.0 andm = 1.0 rad/pixel in equation (1).

In the wavelet analysis, the scale was discretized toincrease the resolution around the peak as follows:

sj = 2π

k2

(k2

k1

)j/N

, j = 0, 1, . . . , N, (10)

such that �sj/sj = (k2/k1)1/N −1, where k1 and k2 are chosen

around the lower and upper bounds of the power spectrumof the fringe signal (i.e. where |G(k)| → 0), and N is thetotal number of the scale. This point is important for thewavelet gradient method, since the absolute uncertainty inphase gradient due to the scale resolution is

�ϕ′ = c +√

c2 + 2

2smax

�s

s. (11)

In this simulation, the scale was discretized by takingk1 = 0.9 rad/pixel, k2 = 1.25 rad/pixel and N = 2000 inequation (10). The phase gradient recovered from the wavelettransform and the gradient of the simulated phase functionare plotted in figure 1(b). The mean absolute error in phasegradient is ≈ 2 × 10−4 rad/pixel and supports equation (11).The simulated phase was recovered by applying the above-mentioned methods and is shown in figure 1(c). The phaseerrors with respect to simulated phase are shown in figure 1(d)for comparison, and these seem to be related to the secondderivative of the phase. Perhaps this is due to neglecting higherorder terms in the Taylor expansion of the phase function inthe present theory. The results reveal that the relative phaseerrors are of the order of 10−3. Although the phase error of

Projector CCD Camerad

L

z p

y x

z Object

Reference plane p0

θ

Figure 3. Experimental setup for fringe projection.

Figure 4. Sinusoidal fringe projected image of the bust of Ataturk.

the CWT gradient method is higher, it could be reduced byincreasing N at the cost of increasing the computation time.As shown in figure 2, the mean absolute error in phase fromthe gradient method decreases to the same value of ≈ 3 ×10−3 rad. attained by the CWT phase (which is independentof N) and FTP methods with N = 5000 at about 10 s in theMatlab environment on a standard PC (Pentium 4, 2.0 GHz).

3. Experimental work

A bust of Ataturk was used as test object to measure its heightprofile. A sinusoidal fringe pattern was projected by an LCDprojector (Sony XGA VPL-CX5) with a resolution 800 ×600 pixel onto the object as shown in figure 3. The distancefrom camera to reference plane, L, was 174.0 cm and thedistance between projector and CCD camera (Sony DSC-P2,1600 × 1200 pixel), d, was 14 cm. The CCD camera was

1770

Page 5: matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

Continuous wavelet transform analysis of projected fringe patterns

Figure 5. The calculated height profile of the bust of Ataturk by theCWT gradient method.

Figure 6. The calculated height profile of the bust of Ataturk by theCWT phase method.

focused on the centre of the reference plane to obtain thecarrier frequency of the projected fringe and its height profile.The reference image was captured and stored in the camera’smemory as an RGB image. Then, the bust of Ataturk was putonto the reference plane and the object’s image was captured asshown in figure 4. These two stored images were laterdownloaded to computer and converted to greyscale imagesfor analysis.

In this work, the wavelet transform routine of Torrenceand Compo [9] for Matlab was adapted to our work. Theheight profile of the object is calculated by three methods. i.e.using the phase gradient of the wavelet transform, the phaseof the wavelet transform and FTP.

In the phase gradient method, one-dimensional wavelettransforms of the reference and object images were calculated

Figure 7. The calculated height profile of the bust of Ataturk by theFTP method.

0 100 200 300 400x-pixel

0.0

0.5

1.0

1.5

Hei

ght

(cm

)

CWT gradientCWT phaseFTP

Figure 8. The calculated height profile of line y = 250 (CWTgradient: solid line, CWT phase: triangle, FTP: square).

using the Morlet mother wavelet for each y. The phase gradientdistributions were calculated from equation (8) with m =0.72 rad/pixel as determined from the reference image. Thesephase gradients were then integrated by trapezoidal algorithmto obtain the phase distribution of the reference image,ϕR(x, y), and the object image, ϕO(x, y). Finally, the phasedistribution of the object, ϕ(x, y) = ϕO(x, y) − ϕR(x, y),was calculated and its height profile determined by usingequation (12) according to Takeda [2]:

z(x, y) = Lp0[

ϕ(x,y)

]p0

[ϕ(x,y)

] − d, (12)

where p0 = p/ cos(θ) and p is the fringe period. It is depictedin figure 5.

In the phase-of-wavelet method, the phase is calculatedat wavelet ridges for each row. Then, the obtained phase,as wrapped in the [−π, +π] range, is unwrapped using theunwrap procedure of Matlab to correct discontinuities in thewrapped phase. Finally, the height profile of the object wasobtained by using this unwrapped phase distribution and it isshown in figure 6. Furthermore, the height profile distribution

1771

Page 6: matlab iopscience.iop.org_0957-0233_15_9_013_pdf_0957-0233_15_9_013

A Dursun et al

Figure 9. Height profile error of the bust of Ataturk by the CWTgradient method.

obtained by the FTP method and the height profiles of theobject for the line y = 250 obtained by using these threemethods are plotted in figures 7 and 8 respectively for furthercomparison. The height profile error of the object obtainedfrom the CWT gradient method is shown in figure 9. Thewhite coded area near the nose in the image gives a highererror rate, ≈1.5%, because a large height gradient is availablein these regions, and it is also enhanced by integration of thephase gradient.

4. Conclusion

The CWT of projected fringes using the Morlet motherwavelet is used to recover the phase distribution of projectedfringes, and hence the height profile of the object, for thefirst time to our knowledge. The simulations revealedthat the absolute error in phase evaluation seems to berelated to the higher order derivatives of the phase (andhence the height profile) of the object. This error is dueto approximations made by Taylor expansion of the phasefunction in which only terms up to first order are consideredin the present theory. Although increasing the number of the

scale in the CWT gradient method reduces the error in therecovered phase, choosing high N increases the computationtime. In this context, preliminary work showed that by usinga compiled language, such as Oberon, this long computationtime could be further cut down about ten-fold. The error inthe CWT phase method is independent of N, which meansmuch shorter computation time. However, the CWT gradientmethod has the advantage of not requiring any unwrappingprocess, unlike the FTP and CWT phase methods, which givealmost identical results. The results are attractive in the senseof comfortable applicability of the CWT method for heightprofile determination in many different fields.

Acknowledgment

This work was partially supported by the Turkish Scientificand Technical Research Council (TUBITAK-MISAG).

References

[1] Acquisto L D, Frantini L and Siddiolo A M 2002 A modifiedmoire technique for three-dimensional surface topographyMeas. Sci. Technol. 13 613–22

[2] Takeda M and Mutoh K 1983 Fourier transform profilometryfor the automatic of 3-D object shapes Appl. Opt. 223977–82

[3] Su X and Chen W 2001 Fourier transform profilometry: areview Opt. Lasers Eng. 35 263–84

[4] Asundi A and Wensen Z 1998 Fast phase-unwrappingalgorithm based on a gray-scale mask and flood fill Appl.Opt. 37 5416–23

[5] Watkins L R, Tan S M and Barnes T H 1999 Determination ofinterferometer phase distributions by use of wavelets Opt.Lett. 4 905–7

[6] Afifi M, Fassi-Fihri A, Nassim K, Sidki M and Rachafi S 2002Paul wavelet-based algorithm for optical phase distributionevaluation Opt. Commun. 211 47–51

[7] Escalona R 2003 Study of axial absorption in liquids byinterferometry J. Opt. A: Pure Appl. Opt. 5 S355–60

[8] Meyers S D, Kelly B G and O’Brien J J 1993 An introductionto wavelet analysis in oceanography and meteorology: withapplication to the dispersion of Yanai waves Mon. WeatherRev. 121 2858–66

[9] Torrence C and Compo G P 1998 A practical guide to waveletanalysis Bull. Am. Meteorol. Soc. 79 61–78

[10] Koysal O, San E S, Ozder S and Ecevit F N 2003 A novelapproach for the determination of birefringence dispersionin nematic liquid crystals by using the continuous wavelettransform Meas. Sci. Technol. 14 790–5

1772