 Research
 Open Access
 Published:
Stair phasecoding fringe plus phaseshifting used in 3D measuring profilometry
Journal of the European Optical SocietyRapid Publications volume 12, Article number: 9 (2016)
Abstract
As the number of codewords adopted in phasecoding fringes increases, the solution of fringe orders leads to many mistakes. Consequently, errors of the unwrapped phase occur. Thus, increasing the codeword approach in a phasecoding fringe remains a challenge. In this paper, a modified stair phasecoding fringe is designed, and a new phase unwrapping algorithm based on shifting fringe order is presented. The main idea of this method is that the width ratio between the sinusoidal fringe and each stair phase of phasecoding fringe is set to 1: n. The fringe order retrieved from the phasecoding fringe can be multiplied by the shift itself, thereby assisting phase unwrapping. This method adopts fewer codewords to replace the usual large number. As such, the approach gains two merits. One is that it guarantees a high measurement accuracy. The other is that it allows the measurement of isolated objects with complicated shapes. The experiments demonstrate that the proposed method is simple but effective.
Background
With the rapidly development of computer technology, optical and optoelectronic technology, threedimensional measurement theory and technology based on structured light has been rapid developed. Many methods have been proposed to recover 3D surface geometry using different principles [1]. Those methods characterized by noncontact operation, fullfield acquisition and fast data processing has been widely used in industrial inspection, quality control, reverse engineering, microfabrication and other fields [2–6].
Many methods have been utilized to measure complex surfaces. Zhao et al. [7] used two phase images with different precision in unwrapping. Considering the numerous images required in Zhao’s method, Li et al. [8] proposed twofrequency grating profilometry, which entails only one grating instead of changing gratings with different equivalent wavelengths. Zhang et al. [9] presented a phase unwrapping algorithm based on multifrequency fringe projection. The method of combined fringes is also used in 3D measurement. Zhang et al. [10] suggested a method that embeds a specklelike signal in three sinusoidal fringe patterns to eliminate phase ambiguity. Basing from this technique, Feng et al. [11] proposed a novel speckleembedded fringe projection method using a graphics processing unit to process data in real time. The Gray code plus phaseshifting method determines the codewords from image intensity [12–14]. However, the measurement resolution is limited by the errors derived from graylevel quantization and noise. Meanwhile, the codewords are less robust for measuring highcontrast surfaces and limited to 2^{m} (where m is regarded as the number of Gray code patterns). Liu et al. [15] developed a novel encodedphase technique for phase measuring profilometry, in which the differentially wrapped phases are regarded as codewords. This method is suitable for capturing dynamic scenes, but it is influenced by object texture and noise. Wang et al. [16] presented a novel absolute phase recovery technique with a phasecoding fringe. This technique not only produces more codewords but also receives more robust measurement results for different fringe image brightness levels compared with Gray code techniques. Fu et al. [17] followed Wang’s theory and measured a blade with a complex shape. However, the measurement accuracy was reduced when numerous codewords were adopted. Different from the method proposed by Wang, Zheng et al. [18] introduced a technique wherein two sets of phasecoding fringes are projected to address the difficulty in judging the fringe order. Basing from Zheng’s foundation, Zhou et al. [19] developed a color fringe coding method to hasten the measurement speed. However, this technique was required to handle the color crosstalk. Chen [20] added a correction method to stabilize the phaseunwrapping algorithm. Meanwhile, Xu et al. [21] proposed an encoding strategy that increases the range of unique phase distribution to 10π. This method is capable of reconstructing holes, steps, and other complicated shapes.
We propose the use of phase shifting algorithms to codify the codewords, which could be used for unwrapping procedure. In general, we need to project two sets of fringes: the first one set consists of a sequence of sinusoidal fringe patterns used to determine the profile of the object under test, and the second is a sequence of stair phasecoding fringes used for determining the fringe orders. Moreover, two issues must be clarified. First, basing from Zhou’s method [19] shown in Fig. 1a, we design a modified stair phasecoding fringe that exactly retrieves the codewords. Second, the width ratio between the sinusoidal fringe and each stair phase of phasecoding fringe is set to 1: n. To facilitate the narrative, we use n = 2 as an example (Fig. 1b). In specific, each stair codeword corresponds to two wrapped phases. The width of each stair phase can be doubled by shifting itself. Then, the width of each stair phase and wrapped phase can be equal, and phase unwrapping can be achieved.
The paper is organized as follows. Section Methods describes the principles of the proposed method. Section Experiments and Results presents the experiments and results. Section Discussion discusses how to generate good measurement results. Finally, Section Conclusion provides the conclusion.
Methods
Measurement system
The measurement system based on triangulation is shown in Fig. 2. The optical center of the Digital Light Processing (DLP) and the ChargeCoupledDevice (CCD) camera are Point E and C, respectively. The optical axis of the projector and that of the CCD camera intersect at origin point O. The fringe is projected onto the measured object. The deformed fringe pattern is captured by the CCD camera. The height of the measured object can be expressed as follows [22]:
Where l_{0} is the distance between the entrance pupil of the CCD camera and the reference plane, and d is the distance between the entrance pupil of the CCD camera and the exit pupil of the projector. f _{ 0 } is the spatial frequency of the sinusoidal fringe pattern on the reference plane. Δϕ is the phase difference between the corresponding point on the object and reference plane. The parameters l _{ 0 }, d and f _{ 0 } are obtained by calibration. The verticality and parallel of the system are calibrated by the method of reference [23].
Fourstep phaseshifting algorithm
Phaseshifting method had been extensively adopted in optical metrology because of its measurement speed and accuracy. Over the years, a variety of phaseshifting algorithms have been developed, that include threestep, fourstep, and leasesquare algorithms [24]. Fourstep phaseshifting algorithm can avoid the 1th and 2th nonlinearity of the measurement system [25]. In consideration of the measurement speed and accuracy, fourstep phaseshifting algorithm is adopted in this paper.
In general, a fourstep phaseshifting algorithm with equal phase shifts can be described as:
Here, A(x, y) is the average intensity, B(x, y) is the intensity modulation and Φ(x, y) is the phase to be solved for. Simultaneously, solving Eqs. (2)(5) leads to
The phase obtained in Eq. (6) ranges from − π to π with 2π discontinuities. A phaseunwrapping algorithm should be used to obtain continuous phase.
Algorithm of the designed stair phasecoding fringe
The following steps comprise the process of a modified stair phasecoding fringe.

(1)
Embed the codeword into the phase φ′(x, y) with the following stair phase function:
$$ {\varphi}^{\prime}\left(x,y\right)=\hbox{} \pi +\mathrm{floor}\left[\frac{ \mod \left(x\hbox{} 1,\mathrm{p}\times \mathrm{N}\right)}{\mathrm{p}}\right]\times \frac{2\pi }{\mathrm{N}\hbox{} 1} $$(7)where floor[x] is the largest integer not greater than x, mod(x, y) is the remainder after the division of x by y, p is the number of pixels per stair phase, and N is the step number in one rising stair phase. We define S = 1024/(p × N) as the subperiod number that corresponds to the segment number of φ′(x, y). In this section, p = 64, N = 4, and S = 4. The phase φ′(x, y) is denoted as a red dashanddot line in Fig. 3.

(2)
Normalize the phase φ′(x, y) as follows:
$$ \varphi \left(x,y\right)=3.13+\left[\frac{\varphi^{\prime}\left(x,y\right) \min \left({\varphi}^{\prime}\left(x,y\right)\right)}{ \max \left({\varphi}^{\prime}\left(x,y\right)\right) \min \left({\varphi}^{\prime}\left(x,y\right)\right)}\right]\times 2\times 3.13 $$(8)where φ(x, y) is the coding phase ranging from −3.13 to 3.13, max(x) is the maximum value of x, and min(φ′) is the minimum value of φ′. The coding phase φ(x, y) is represented by a solid blue line in Fig. 3.

(3)
Put the coding phase into fourstep phaseshifting fringe patterns:
$$ {I}_{{}_k}^c\left(x,y\right)=A\left(x,y\right)+B\left(x,y\right) \cos \left[\varphi \left(x,y\right)+\left(k1\right)\frac{\pi }{2}\right] $$(9)where k = 1, 2, 3, 4. The phaseshifting fringe \( {I}_{{}_4}^c \) is displayed in Fig. 4.
New phase unwrapping algorithm

(1)
Calculate coding phase φ(x, y) with the phaseshifting algorithm:
$$ \varphi \left(x,y\right)={ \tan}^{1}\left(\frac{I_{{}_4}^c{I}_{{}_2}^c}{I_{{}_1}^c{I}_{{}_3}^c}\right) $$(10)As shown in Fig. 5, the blue line means one cross section of coding phase φ(x, y).

(2)
Quantize the decimal coding phase φ(x, y) into the segmented integer fringe order k _{00}(x, y):
$$ {k}_{00}\left(x,y\right)=\left(N1\right)\times \left[\frac{\varphi \left(x,y\right) \min \left(\varphi \left(x,y\right)\right)}{ \max \left(\varphi \left(x,y\right)\right) \min \left(\varphi \left(x,y\right)\right)}\right]+1 $$(11)The segmented integer fringe order k _{00}(x, y) is represented by a red dashanddot line in Fig. 5.

(3)
Generate a contrary fringe order k _{01}(x, y):
$$ {k}_{01}\left(x,y\right)=N+1{k}_{00}\left(x,y\right) $$(12)The contrary fringe order k _{01}(x, y) is denoted as a black line in Fig. 6.

(4)
Find the jump pixel point in the segmented fringe order as follows:
$$ {k}_{01}\left(x,y\right){k}_{00}\left(x,y\right)==N1 $$(13)In Fig. 6a, b, and c denote the jump pixel points in the pixel axis. When the two segmented fringe orders satisfy Eq. (13), the pixels are saved in the jump pixel points matrix [a, b, c]_{ x × 3}.

(5)
Connect the segmented fringe order to a continuous fringe order k _{1}(x, y) as follows:
$$ \left\{\begin{array}{l}{k}_1\left(x,1:a\right)={k}_{00}\left(x,1:a\right)\\ {}{k}_1\left(x,a+1:b\right)={k}_{00}\left(x,a+1:b\right)+N\times 1\\ {}{k}_1\left(x,b+1:c\right)={k}_{00}\left(x,b+1:c\right)+N\times 2\\ {}{k}_1\left(x,c+1:\mathrm{s}\right)={k}_{00}\left(x,c+1:s\right)+N\times 3\end{array}\right. $$(14)where s is the total pixels in each row, and s = 1024.

(6)
Create a new fringe order by the shift half frequency of k _{1} as shown below:
$$ {k}_2\left(x,y\right)=\left\{\begin{array}{cc}\hfill {k}_1\left(x,y+p/2\right),\hfill & \hfill y>p/2\hfill \\ {}\hfill 0,\hfill & \hfill y\le p/2\hfill \end{array}\right. $$(15)$$ k\left(x,y\right)={k}_1\left(x,y\right)+{k}_2\left(x,y\right) $$(16)where k _{2}(x,y) is the shifted fringe order and k(x, y) is the new fringe order. Additional details are provided in the magnifying frame in Fig. 7.

(7)
Obtain the continue phase Ψ(x, y) as follows:
$$ \Psi \left(x,y\right)=2\pi \times k\left(x,y\right)+\Phi \left(x,y\right) $$(17)In Fig. 8, the blue line denotes the wrapped phase, and the red line represents the fringe order k(x, y).
Experiments and results
Measurement of a long strip
A contrasting experiment of a long strip is first carried out to demonstrate the effectiveness of the proposed method. The width of sinusoidal fringe is 16 pixels. One group possesses a the width ratio between the sinusoidal fringe and each stair phase of phasecoding fringe of 1:1 (Fig. 9(a)). In this case, p = 16, N = 8 and S = 8. The other group involves a corresponding ratio of 1:2 (Fig. 9b), in which p = 32, N = 8 and S = 4.
The reconstructed 3D results of the long strip with two strategies are shown in Fig. 10. Figure 10a, b correspond to width ratios of 1:1 and 1:2, respectively. The errors in Fig. 10a can be attributed to incorrect fringe order. Figure 10b displays accurate results after using the proposed method.
Measurement of a foam holder
A foam holder with two large holes was also employed to compare experimental results using four methods, including Wang’s, Zheng’s, and Zhou’s methods, as well as the proposed approach. The width of sinusoidal fringe is 32 pixels. Figure 11a shows a phasecoding fringe that uses Wang’s method. Figure 11b displays a set of phasecoding fringes that adopts Zheng’s technique. Figure 11c reveals a phasecoding fringe in grayscale mode that employs Zhou’s approach, and Fig. 11d shows a set of phasecoding fringes that utilizes the proposed method. The reconstructed 3D results are exhibited in Fig. 12a–d, the 3D shape result of the proposed method overmatches that of the others. The RMSs of the height errors in Fig. 12a–d are 0.066, 0.049, 0.043 and 0.035 mm respectively.
Measurement of isolated objects
Another experiment that includes a complex face model and a computer mouse was provided to demonstrate that the proposed method can measure isolated objects with complicated shapes. The object modulated by sinusoidal fringes is shown in Fig. 13a, the width of sinusoidal fringe is 16 pixels, and the object modulated by phasecoding fringes is shown in Fig. 13b. The 3D result with phase error compensation [26] is presented in Fig. 14.
Measurement of a standard gauge block
Four standard gauge blocks with different heights were measured using the proposed method to verify further the measurement accuracy. The measured area was approximately 500 mm × 800 mm. The width of sinusoidal fringe is 32 pixels, Fig. 15a, b show the four standard gauge blocks modulated by sinusoidal and phasecoding fringes, respectively. Figure 16 displays the 3D shape of the four standard gauge blocks obtained using the proposed method. Table 1 lists the absolute and RMS errors for each standard gauge block. The maximum absolute error is 0.041 mm, and the maximum RMS error is 0.033 mm. The quantitative analysis reveals the accuracy of the proposed method.
Discussion
To show when the proposed method have a better measurement result, the relationship between the stair and subperiod numbers are extensively analyzed. The long strip was measured again in this part, and the width of sinusoidal fringe is 21.33 pixels (Fig. 17a–d), and the period numbers while using the phasecoding fringe are 48, 24, 16, and 12. That is to say, the fringe frequency ratios are 1:1, 1:2, 1:3, and 1:4, respectively. The subperiod number of the phasecoding fringe is (S=) 4 for all. The stair number in a subperiod number of the phasecoding fringe is given by (N=) 12, 6, 4, and 3, respectively. Figure 18 shows the corresponding 3D results. From the results, two conclusions are noted. One is that at the case of the different width ratio between the sinusoidal fringe and each stair phase of phasecoding fringe, the measurement achieves a better result when S is close to N. This finding is easily understood because the fringe order is readily identified correctly when N is small. The other is that the method can achieve measurement, although the phasecoding fringe intensity is lower. This condition is allowed because this fringe based on phase code is resistant to surface contrast variations, ambient light, and camera noises. The phasecoding fringe in Fig. 17d is presented as an illustration.
Conclusion
A modified stair phasecoding fringe was designed, and a new phase unwrapping algorithm based on stair phasecoding fringe was presented. This method used a large number of codewords as much as the resolution ratio of CCD allows, it can correctly judge the fringe order, achieving accurate phase unwrapping. The width ratio between the sinusoidal fringe and each stair phase of phasecoding fringe is set to 1: n. Compared with other methods, the proposed method adopts a lower number instead of numerous codewords. Therefore, the proposed approach gains two merits. One is that it can improve the measurement accuracy, the other is that it can measure isolated objects with complicated shapes. In our future work, two issues remain to be addressed: correction of the nonuniformity of the stair phasecoding fringe during largescene measurements and encoding of a composite color pattern for the dynamic scene.
References
Zhang, S: Handbook of 3D Machine Vision: Optical Metrology and Imaging. Lasers Optics & Photonics, London New York (2013)
Gorthi, SS, Rastogi, P: Fringe projection techniques: whither we are? Opt. Lasers Eng. 48(2), 133–140 (2010)
Geng, J: Structuredlight 3D surface imaging: a tutorial. Adv. Opt. Photonics. 3(2), 128–160 (2011)
Zhao, B, Zhao, HJ, Xie, HM: Advanced optical measurement methods and its applications. Opt. Lasers Eng. 54, 139–140 (2014)
Jiang, C, Jia, S, Xu, Y, et al.: The application of multifrequency fringe projection profilometry on the measurement of biological tissues. BioMed. Mater. Eng. 26(s1), 395–403 (2015)
Liu, J, Tan, J, Zhao, C, et al.: Phaseshift resolving confocal microscopy with high axial resolution, wide range and reflectance disturbance resistibility. Opt. Express 17(18), 16281–16290 (2009)
Zhao, H, Chen, W, Tan, Y: Phaseunwrapping algorithm for the measurement of threedimensional object shapes. Appl. Opt. 33(20), 4497–4500 (1994)
Li, J, Su, H, Su, X: Twofrequency grating used in phasemeasuring profilometry. Appl. Opt. 36(1), 277–280 (1997)
Zhang, C, Zhao, H, Gu, F, et al.: Phase unwrapping algorithm based on multifrequency fringe projection and fringe background for fringe projection profilometry. Meas. Sci. Technol. 26(4), 045203 (2015)
Zhang, Y, Xiong, Z, Wu, F: Unambiguous 3D measurement from speckleembedded fringe. Appl. Opt. 52(32), 7797–7805 (2013)
Feng, S, Chen, Q, Zuo, C: Graphics processing unit–assisted realtime threedimensional measurement using speckleembedded fringe. Appl. Opt. 54(22), 6865–6873 (2015)
Sansoni, G, Corini, S, Lazzari, S, et al.: Threedimensional imaging based on Graycode light projection: characterization of the measuring algorithm and development of a measuring system for industrial applications. Appl. Opt. 36(19), 4463–4472 (1997)
Sansoni, G, Carocci, M, Rodella, R: Threedimensional vision based on a combination of graycode and phaseshift light projection: analysis and compensation of the systematic errors. Appl. Opt. 38(31), 6565–6573 (1999)
Zheng, D, Da, F: Selfcorrection phase unwrapping method based on Graycode light. Opt. Lasers Eng. 50(8), 1130–1139 (2012)
Liu, Y, Su, X, Zhang, Q: A novel encodedphase technique for phase measuring profilometry. Opt. Express 19(15), 14137–14144 (2011)
Wang, Y, Zhang, S: Novel phasecoding method for absolute phase retrieval. Opt. Letters. 37(11), 2067–2069 (2012)
Fu, Y, Wang, Y, Wan, M, et al.: Threedimensional profile measurement of the blade based on surface structured light. OptikInt. J. Light Electron Opt. 124(18), 3225–3229 (2013)
Zheng, D, Da, F: Phase coding method for absolute phase retrieval with a large number of codewords. Opt. Express 20(22), 24139–24150 (2012)
Zhou, C, Liu, T, Si, S, et al.: An improved stair phase encoding method for absolute phase retrieval. Opt. Lasers Eng. 66, 269–278 (2015)
Chen, F, Su, X: Phaseunwrapping algorithm for the measurement of 3D object. OptikInt. J. Light Electron Opt. 123(24), 2272–2275 (2012)
Xu, J, Liu, S, Wan, A, et al.: An absolute phase technique for 3D profile measurement using fourstep structured light pattern. Opt. Lasers Eng. 50(9), 1274–1280 (2012)
Xu, Q: System calibration technique of profilometry by projected grating. Opt. Tech. 26(2; ISSU 142), 126–129 (2000)
Takeda, M, Mutoh, K: Fourier transform profilometry for the automatic measurement of 3D object shapes. Appl. Opt. 22(24), 3977–3982 (1983)
Malacara, D: Optical Shop Testing (Wiley Series in Pure and Applied Optics). WileyInterscience, Canada (2007)
Zhou, L, Su, X, Wang, L: Analysis of errors introduced by detector nonlinearity in Phase Measuring Profilometry. Laser Journal 3, 009 (2002) (in Chinese)
Zhang, S, Huang, PS: Phase error compensation for a 3D shape measurement system based on the phaseshifting method. Opt. Eng. 46(6), 0636010636019 (2007)
Acknowledgment
This project is supported by the National Natural Science Foundation of China (Grant No. 51365045,61462063), Shanghai Aerospace Science and Technology Innovation Fund (Grant No. SAST2015046).
Competing interests
The authors declare that they have no competing interests.
Authors contributions
All authors read and approved the final manuscript.
Author information
Affiliations
Corresponding author
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Zeng, Z., Li, B., Fu, Y. et al. Stair phasecoding fringe plus phaseshifting used in 3D measuring profilometry. J. Eur. Opt. Soc.Rapid Publ. 12, 9 (2016). https://doi.org/10.1186/s4147601600139
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s4147601600139
Keywords
 Phasecoding fringe
 Phase measuring profilometry
 Phase unwrapping
 Phaseshifting