# Multi-Wavelength Digital-Phase-Shifting Moire Based on Moire Wavelength
## 2 Method  
### Digital Phase-Shifting Moire  
The method of multi-wavelength digital phase-shifting moire based on moire wavelength involves projecting multiple binary grid patterns (black-and-white stripes) of different pitch onto an object surface, and capturing only a single image for each projected pattern. Then, for each camera-captured image of different predetermined camera-pixel pitch, a synthetically produced (computer generated) virtual binary grid of the same camera-pixel pitch as the camera-captured image is overlaid on the capturedimage and digitally shifted to generate multiple phase-shifted moire images [17]. The generated phase-shifted moire images contain the moire contours with sinusoidal intensity distribution as well as the unwanted high-frequency grid lines. Stationary-wavelet Fourier-transform grid-noise removal [19] is applied to these images to extract pure moire patterns. Further explanation of the generation of moire patterns with grid-noise and the extraction of pure moire patterns is given in Appendix A. The intensity distribution of the phase-shifted moire patterns after grid removal is described by:  
\[I_{i}(x,y)=a(x,y)+b(x,y)\cos(\Phi(x,y)+\delta_{i}), \tag{1}\]  
where \(a(x,y)\) and \(b(x,y)\) are intensity background and modulation, respectively, (\(x\),\(y\)) are the image coordinates, \(\Phi\)(\(x\),\(y\)) is the phase map that contains object height information, and \(\delta_{i}=2\pi i/N\) are the phase-shifts between images. To calculate the phase map \(\Phi\)(\(x\),\(y\)), at least three images (\(N=3\)) of phase-shifted moire patterns are required:  
\[\Phi(x,y)=-\tan^{-1}\left(\frac{\sum_{i=1}^{N}I_{i}(x,y)\sin\delta_{i}}{\sum_{ i=1}^{N}I_{i}(x,y)\cos\delta_{i}}\right),\ i=1,2,\ldots,N. \tag{2}\]  
Equation (2) with \(N\) equally-spaced phase shifts represents a general approach. As with PSP methods, increasing the number of phase shifts would improve the accuracy of the phase map. Considering that the pitch of the computer-generated virtual binary grid is the pitch of the camera image, to generate the maximum number of phase-shifted moire images, the virtual binary grid can be shifted \(N\) times by one pixel. Since subpixel phase shifting of the virtual grid by digital means is not possible in digital moire, the maximum number of generated phase shifts is equal to the pitch of the camera-captured grid. For example, for a 10-pixel grid pitch, 10 phase-shifted moire patterns with a phase shift of 2\(\pi\)/10 with respect to the previous shift can be synthetically (computer) generated. In this paper, the advantage of digital moire that all phase shifting is done digitally as a post-process, can be applied to compute each phase map (for each pitch), without increasing the number of captured images. Thus, using digital phase-shifting moire, high quality phase maps can be computed by capturing only one camera image for each phase map (i.e., in the above example, 10 phase-shifted moire patterns to compute a phase map, using a single camera captured image). Because of the arctangent function in Equation (2), the computed phase \(\Phi\)(\(x\),\(y\)) is wrapped with 2\(\pi\) discontinuities and a phase unwrapping technique is required to calculate a continuous phase map \(\Phi\)(\(x\),\(y\)). This process removes the 2\(\pi\) ambiguities of the wrapped phase according to the fringe order \(m\)(\(x\),\(y\)) to determine the unwrapped phase \(\varphi\)(\(x\),\(y\)):  
\[\varphi(x,y)=\Phi(x,y)+(2\pi)m(x,y). \tag{3}\]  
The complete process of phase unwrapping to obtain \(\varphi\)(\(x\),\(y\)) is explained in Section 2.3. The relationship between the computed unwrapped phase \(\varphi\)(\(x\),\(y\)) and object height \(h\) depends on the system-geometry parameters and can be expressed as:  
\[h(x,y)=K\,\varphi(x,y)(1-h/H), \tag{4}\]  
where the coefficient \(K\) is a function of the moire-wavelength \(\lambda\); \(K=\lambda/2\pi\), \(\lambda\approx pH/d\), \(p\) is the grid pitch, \(d\) is the projector to camera distance, and \(H\) is the camera-projector to object distance [1].