## Abstract

This paper makes use of Hilbert transform to analyze and compensate the phase error caused by the nonlinear effect in phase shifting profilometry (PSP). The characteristics of the phase error distribution in Hilbert transform domain was analyzed and compared with spatial domain. A simple and flexible phase error compensation method was proposed to directly process the phase-shifting fringe images without any auxiliary conditions or complicated computation. Experimental results demonstrated that the phase error can be reduced by about 80% in three-step PSP, and more than 95% in four or more step PSP, which verified the effectiveness, flexibility, robustness and automation of the proposed phase error compensation method.

© 2015 Optical Society of America

## 1. Introduction

Phase shifting profilometry (PSP) has been developed rapidly for three dimensional (3D) shape measurement with the advantage of high-speed, high-resolution and high-accuracy [1–3 ]. In PSP system, some error sources, such as sensor noise, nonlinear response and quantization error, are introduced by the commercially available digital devices [4–6 ]. The nonlinear response named gamma effect, as a main error source, deviates a standard fringe pattern from ideal sinusoidal signal and brings considerable phase error into PSP. Recently various phase error compensation methods have been proposed [7–23 ]. However, some auxiliary conditions are required to achieve the goal of phase error compensation. For example, one sort of the compensation methods depends on a calibration procedure to quantify the nonlinearity of system response by using response curve fitting [7–9 ], phase benchmark building [10, 11 ], gamma model derivation [12–17 ], etc. Although the phase error caused by the nonlinear response can be compensated effectively with these methods, the calibration procedure is time-consuming and laborious. Moreover, because the operations of the calibration and measurement are sequential, this can lead to the disturbances in invalid calibration results and result in the growth of the phase error. In addition, other kind of non-calibration error compensation methods relied on defocusing technology [18–23 ]. The defocusing can actually work as a low-pass filter to eliminate high-frequency harmonics. However, it is a difficult task to control the degree of defocusing precisely, as mentioned in [24, 25 ].

To address the aforementioned issues, we try to investigate a flexible and robust compensation method against environment instabilities and independence on additional auxiliary conditions. The Hilbert transform (HT) has been introduced to extract the phase information from single-frame fringe pattern [26–34 ]. The main characteristic of the HT is that it will induce a phase shift of $\pi /2$ to a signal with its amplitude remained but its DC component removed [27]. Considering the periodical distribution of the phase error in spatial domain [13], it can be predicted that the phase error distribution in HT domain should have the similar features. Furthermore, because of the phase shift induced by the HT, it is likely to make the phase errors have opposite distributional tendency in spatial domain and HT domains, respectively.

In this paper, the phase error models in spatial domain and HT domain are deduced explicitly, which are suitable to any step of PSP. Then we analyzed their characteristics and verify the prediction that the phase errors in the two domains are both periodic distributions with identical amplitude and opposite direction. Therefore, the phase error can be compensated flexibly and simply by averaging the phases in the two domains. Experimental results demonstrated that it is suitable for flexible, high-robust and automatic phase error compensation without requiring any auxiliary condition or complicated computation.

## 2. Principle

#### 2.1. Phase error model in spatial domain

In ideal case (i.e. linear intensity response), the intensity of the *n*th captured image in *N*-step PSP can be represented as

In practice, the intrinsic nonlinear intensity response of a projector-camera setup introduces the high-order harmonics into the fundamental harmonic of fringe patterns. According to power-law response [35], the gamma-distorted intensity can be represented as [13]

*k*-order harmonic component respectively, ${\varphi}_{n}$ represents the modulated phase coupled with the phase shift, and $\gamma $ is the gamma factor.

Based on the least square algorithm (LSA), the modulated phase can be worked out as

We directly derive a phase error model of PSP system in a simple way as follow:

*N*-order harmonic. Furthermore, ${G}_{N+1}$ can be neglected because of its little contribution to the gamma correction. Therefore, Eq. (7) can be further simplified as

#### 2.2. Phase error model in HT domain

The HT of the *n*th captured phase-shifting image can be represented as

Due to the gamma effect, there are also high-order harmonics existing in the transformed intensity, which can be represented as

To make equal to $\varphi $, the LSA-based phase in HT domain can be expressed by

The gamma-distorted phase in HT domain is

Similarly, we deduce the phase error model of PSP system in HT domain as

## 3. Phase error compensation method

#### 3.1. Characteristics of phase error distribution

Based on above phase error models, the characteristics of phase error distribution in the two domains can be discussed and analyzed. Equations (9) and (15) reveal that the phase errors in spatial domain and HT domain are trigonometric functions with respect to phase $\varphi $, whose periods are both $T=2\pi /N$. Let $\partial \Delta \varphi /\partial \varphi =0$ in Eq. (9) and $\partial \Delta {\varphi}^{H}/\partial \varphi =0$ in Eq. (15), the amplitude of the phase error distributions, namely the maximum phase errors, in the two domains can be obtained respectively by Eqs. (16) and (17)

- (1) The same period of $T=2\pi /N$;
- (2) The same amplitude of $A=\mathrm{arc}\mathrm{sin}\left(\left|{G}_{N-1}\right|\right)$, as shown in Eqs. (16) and (17) ;
- (3) The distributions are half period shift, as shown in Eq. (18), leading to the opposite distributional tendency.

To illustrate these characteristics, we created some phase error curves in the two domains through Eqs. (9) and (15) with the parameters of ${G}_{N-1}=0.4$ and $N=3$, as demonstrated in Fig. 1(a) . It is clearly shown that the three stated characteristics are correct, and the values of phase error in the two domains are approximately identical in magnitude and opposite in sign.

#### 3.2. Compensation for phase errors

Let ${\varphi}^{M}=\left({\varphi}^{C}+{\varphi}^{HC}\right)/2$ denote the average phase between the two domains. Combining Eqs. (9) and (15) , the phase error of ${\varphi}^{M}$can be obtained as

In order to quantify the reduction of the maximum phase error, we use the Taylor series expansion of arcsine function considered only the first term, i.e. $\mathrm{arcsin}\left(x\right)=x+1/6{x}^{3}+\circ \left({x}^{5}\right)\approx x,\left|x\right|<1$. The ratio of the maximum phase errors is approximated as

It reveals that after average operation the maximum phase error can be reduced to $\left|{G}_{N-1}\right|/2$ times of the original one. According to Eqs. (16) and (20) , the characteristics of the maximum phase error with respect to various phase-shifting steps and gamma factors are showed in Fig. 1(b). Besides, the relevant data statistics are listed in Table 1 . It is clear that in 3-step PSP the phase error associated with nonlinear response can be reduced by about 80% after average operation, while in four- or more step PSP that can be reduced by more than 95% in the simulation calculation.

Therefore, we propose a phase error compensation method summarized as follow:

**Step 1,**transform the phase-shifting fringe images in spatial domain to HT domain**Step 2,**compute two phases in spatial domain and HT domain using the LSA of Eqs. (3) and (12) , respectively.**Step 3,**average the phases in the two domains to generate the corrected phase.

## 4. Experiments and analysis

We developed a PSP system combining a DLP projector (DELL, M110) and a CMOS camera (DH, MER-130-30UM) with a 16-mm imaging lens (PENTAX, C1614-M) to demonstrate the validity of the proposed method. A white board was taken to be a target. In the experiments, we performed 1D HT algorithm row by row to the captured images in vertical fringe projection. In our 1D HT algorithm, the fast Fourier transform (FFT) of the input discrete signal was calculated firstly. Then those FFT coefficients of negative frequencies were replaced with zeroes, and the inverse FFT was implemented to achieve the result finally. More details can be referred to literature [36]. As the implementation of HT depends on the FFT, some defects such as signals aliasing, truncation effect, spectrum leakage, and so on, may arise in this HT algorithm. Additionally, in the processing of the discrete HT, the sampling of signum function may lead to an approximate result with weak edge effect. The transformed fringe images were used to compute phase in HT domain.

Figure 2 shows one cross section of the phase error distributions with and without compensation. As mentioned before, the phase error distributions in the two domains are identical in amplitude and opposite in direction. In this sense, the phase error is effectively compensated through the average operation. As shown in Fig. 2(a), the experimental results of three-step PSP greatly match with the above features. However, in Fig. 2(b), there is a little mismatch about the phase error distribution after compensation in four-step PSP comparing with the simulation calculation. In our opinion, this mismatch may come from the impacts of other error sources, such as sensor noise, quantization error, ambient light disturbance, because the effect of nonlinear response will be decreased rapidly with the increase of the phase-shifting step, on the other hand, the impact of other error sources will become more significant.

Table 2 lists the maximum (MAX) and root-mean-square (RMS) values of the phase error with and without compensation. It clearly shows the effectiveness of the proposed compensation method.

Another experiment is a 3D digital shape reconstruction of a plaster statue with free-form surface. Figure 3 shows the captured images with uniform and fringe projection illumination. Figure 4 and 5 show the 3D reconstruction results by using three-step and four-step PSP, respectively. In the reconstruction procedure, the 3D coordinates of points on measured object are computed firstly with the phase and calibration information. Then combining the neighboring relations of those points, we can generate the 3D model with triangle meshes. It can be seen that the periodical ripple effect distinctly appears on the reconstructed 3D digital surface because of the nonlinear response. With the phase error compensation, the ripple effect is improved significantly.

In order to evaluate the time efficiency of our method on the processing of HT and phase retrieval, we record the time cost of the experiments. The testing environments are a CPU of i3-4130, a RAM of 8G, and software of MATLAB R2015a. The time costs of performing HT in 3- and 4-step PSP are 1256ms and 1633ms, while that of phase retrieval are 539ms and 596ms. It is obvious that the proposed method just requires a little extra time to perform the phase error compensation automatically and flexibly, without needing for additional information or operation.

## 5. Conclusions

This paper derived the phase error models respectively in spatial domain and HT domain and then analyzed and compared their characteristics of phase error distribution. It was found that the phase error distributions in the two domains are identical in amplitude and opposite in direction. According to this phenomenon, a simple and flexible phase error compensation method was proposed by only using the average phase between the two domains. Theoretical analysis and experimental results indicated that the phase error can be reduced by about 80% in three-step PSP, and more than 95% in four or more step PSP.

## Acknowledgments

We gratefully acknowledge the financial support from the Natural Science Foundation of China (NSFC) under Grant No. 61201355, 61171048, 61377017, 61311130138, 61405122 and the Sino-German Center for Research Promotion (SGCRP) under Grant No. GZ 760. The grants from Scientific and Technological Project of the Shenzhen government(JCYJ20140828163633999), Key Basic Research Project of Applied Basic Research Programs Supported by Hebei Province (15961701D), and Research Project for High-level Talents in Hebei University (GCC2014049) are also acknowledged.

## References and links

**1. **C. Quan, X. Y. He, C. F. Wang, C. J. Tay, and H. M. Shang, “Shape measurement of small objects using LCD fringe projection with phase shifting,” Opt. Commun. **189**(1–3), 21–29 (2001). [CrossRef]

**2. **S. S. Gorthi and P. Rastogi, “Fringe projection techniques: Whither we are?” Opt. Lasers Eng. **48**(2), 133–140 (2010). [CrossRef]

**3. **S. Zhang, “Recent progresses on real-time 3D shape measurement using digital fringe projection techniques,” Opt. Lasers Eng. **48**(2), 149–158 (2010). [CrossRef]

**4. **C. Rathjen, “Statistical properties of phase-shift algorithms,” J. Opt. Soc. Am. A **12**(9), 1997–2008 (1995). [CrossRef]

**5. **G. H. Notni and G. Notni, “Digital fringe projection in 3D shape measurement: an error analysis,” Proc. SPIE **5144**, 372–380 (2003). [CrossRef]

**6. **Z. Wang, D. A. Nguyen, and J. C. Barnes, “Some practical considerations in fringe projection profilometry,” Opt. Lasers Eng. **48**(2), 218–225 (2010). [CrossRef]

**7. **C. R. Coggrave and J. M. Huntley, “High-speed surface profilometer based on a spatial light modulator and pipeline image processor,” Opt. Eng. **38**(9), 1573–1581 (1999). [CrossRef]

**8. **S. Kakunai, T. Sakamoto, and K. Iwata, “Profile measurement taken with liquid-crystal gratings,” Appl. Opt. **38**(13), 2824–2828 (1999). [CrossRef] [PubMed]

**9. **P. S. Huang, C. Zhang, and F. Chiang, “High-speed 3-D shape measurement based on digital fringe projection,” Opt. Eng. **42**(1), 163–168 (2003). [CrossRef]

**10. **S. Zhang and S. T. Yau, “Generic nonsinusoidal phase error correction for three-dimensional shape measurement using a digital video projector,” Appl. Opt. **46**(1), 36–43 (2007). [CrossRef] [PubMed]

**11. **B. Pan, Q. Kemao, L. Huang, and A. Asundi, “Phase error analysis and compensation for nonsinusoidal waveforms in phase-shifting digital fringe projection profilometry,” Opt. Lett. **34**(4), 416–418 (2009). [CrossRef] [PubMed]

**12. **T. Hoang, B. Pan, D. Nguyen, and Z. Wang, “Generic gamma correction for accuracy enhancement in fringe-projection profilometry,” Opt. Lett. **35**(12), 1992–1994 (2010). [CrossRef] [PubMed]

**13. **K. Liu, Y. Wang, D. L. Lau, Q. Hao, and L. G. Hassebrook, “Gamma model and its analysis for phase measuring profilometry,” J. Opt. Soc. Am. A **27**(3), 553–562 (2010). [CrossRef] [PubMed]

**14. **Z. Li and Y. Li, “Gamma-distorted fringe image modeling and accurate gamma correction for fast phase measuring profilometry,” Opt. Lett. **36**(2), 154–156 (2011). [CrossRef] [PubMed]

**15. **X. Zhang, L. Zhu, Y. Li, and D. Tu, “Generic nonsinusoidal fringe model and gamma calibration in phase measuring profilometry,” J. Opt. Soc. Am. A **29**(6), 1047–1058 (2012). [CrossRef] [PubMed]

**16. **S. Ma, C. Quan, R. Zhu, L. Chen, B. Li, and C. J. Tay, “A fast and accurate gamma correction based on Fourier spectrum analysis for digital fringe projection profilometry,” Opt. Commun. **285**(5), 533–538 (2012). [CrossRef]

**17. **H. Cui, Z. Zhao, Y. Wu, N. Dai, X. Cheng, and L. Zhang, “Digital fringe image gamma modeling and new algorithm for phase error compensation,” Optik (Stuttg.) **125**(24), 7175–7181 (2014). [CrossRef]

**18. **X.-Y. Su, W.-S. Zhou, G. von Bally, and D. Vukicevic, “Automated phase-measuring profilometry using defocused projection of a Ronchi grating,” Opt. Commun. **94**(6), 561–573 (1992). [CrossRef]

**19. **M. J. Baker, J. Xi, and J. F. Chicharo, “Elimination of gamma non-linear luminance effects for digital video projection phase measuring profilometers”, in 4th IEEE International Symposium on Electronic Design, Test and Applications (IEEE, 2008), pp. 496–501. [CrossRef]

**20. **S. Lei and S. Zhang, “Flexible 3-D shape measurement using projector defocusing,” Opt. Lett. **34**(20), 3080–3082 (2009). [CrossRef] [PubMed]

**21. **Y. Wang and S. Zhang, “Optimal pulse width modulation for sinusoidal fringe generation with projector defocusing,” Opt. Lett. **35**(24), 4121–4123 (2010). [CrossRef] [PubMed]

**22. **Y. Xu, L. Ekstrand, J. Dai, and S. Zhang, “Phase error compensation for three-dimensional shape measurement with projector defocusing,” Appl. Opt. **50**(17), 2572–2581 (2011). [CrossRef] [PubMed]

**23. **D. Zheng and F. Da, “Absolute phase retrieval for defocused fringe projection three-dimensional measurement,” Opt. Commun. **312**, 302–311 (2014). [CrossRef]

**24. **S. Zhang, Y. Gong, Y. Wang, J. Laughner, and I. G. Efimov, “Some recent advance on high-speed, high-resolution 3-D shape measurement using projector defocusing”, in 2010 International Symposium on Optomechatronic Technologies (IEEE, 2010), pp. 1–6 [CrossRef]

**25. **B. Li, Y. Wang, J. Dai, W. Lohry, and S. Zhang, “Some recent advances on superfast 3D shape measurement with digital binary defocusing techniques,” Opt. Lasers Eng. **54**, 236–246 (2014). [CrossRef]

**26. **D. A. Zweig and R. E. Hufnagel, “Hilbert transform algorithm for fringe-pattern analysis,” Proc. SPIE **1333**, 295–302 (1990). [CrossRef]

**27. **M. A. Sutton, W. Zhao, S. R. McNeill, H. W. Schreier, and Y. J. Chao, “Development and assessment of a single-image fringe projection method for dynamic applications,” Exp. Mech. **41**(3), 205–217 (2001). [CrossRef]

**28. **K. G. Larkin, D. J. Bone, and M. A. Oldfield, “Natural demodulation of two-dimensional fringe patterns. I. General background of the spiral phase quadrature transform,” J. Opt. Soc. Am. A **18**(8), 1862–1870 (2001). [CrossRef] [PubMed]

**29. **K. G. Larkin, “Natural demodulation of two-dimensional fringe patterns. II. Stationary phase analysis of the spiral phase quadrature transform,” J. Opt. Soc. Am. A **18**(8), 1871–1881 (2001). [CrossRef] [PubMed]

**30. **V. Madjarova, H. Kadono, and S. Toyooka, “Dynamic electronic speckle pattern interferometry (DESPI) phase analyses with temporal Hilbert transform,” Opt. Express **11**(6), 617–623 (2003). [CrossRef] [PubMed]

**31. **V. D. Madjarova, H. Kadono, and S. Toyooka, “Use of dynamic electronic speckle pattern interferometry with the Hilbert transform method to investigate thermal expansion of a joint material,” Appl. Opt. **45**(29), 7590–7596 (2006). [CrossRef] [PubMed]

**32. **U. P. Kumar, N. K. Mohan, and M. P. Kothiyal, “Time average vibration fringe analysis using Hilbert transformation,” Appl. Opt. **49**(30), 5777–5786 (2010). [CrossRef] [PubMed]

**33. **M. Trusiak, K. Patorski, and K. Pokorski, “Hilbert-Huang processing for single-exposure two-dimensional grating interferometry,” Opt. Express **21**(23), 28359–28379 (2013). [CrossRef] [PubMed]

**34. **M. Trusiak, K. Patorski, and M. Wielgus, “Hilbert-Huang processing and analysis of complex fringe patterns,” Proc. SPIE **9203**, 92030K (2014). [CrossRef]

**35. **C. A. Poynton, “‘Gamma’ and its disguises: the nonlinear mappings of intensity in perception, CRTs, film, and video,” SMPTE Journal **102**(12), 1099–1108 (1993). [CrossRef]

**36. **S. L. Marple, “Computing the discrete-time ‘analytic’ signal via FFT,” IEEE Trans. Signal Process. **47**(9), 2600–2603 (1999). [CrossRef]