 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
Authors and 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