Phase-shifted algorithm
In this paper, three-step phase-shifted algorithm with a phase shift 2π/3 is applied, because it need the least formulas for its simplicity and speed. The sinusoidal light intensity can be described as:
$$ {I}_1\left(x,y\right)=A\left(x,y\right)+B\left(x,y\right)\cos \left[\varphi \left(x,y\right)\right] $$
(1)
$$ {I}_2\left(x,y\right)=A\left(x,y\right)+B\left(x,y\right)\cos \left[\varphi \left(x,y\right)+\pi /3\right] $$
(2)
$$ {I}_3\left(x,y\right)=A\left(x,y\right)+B\left(x,y\right)\cos \left[\varphi \left(x,y\right)+2\pi /3\right] $$
(3)
Where A(x, y) is the average intensity, B(x, y) is the intensity modulation, and φ(x, y) is the phase needed to be calculated. Based on the Eqs. (1)-(3), the φ(x, y) can be gotten.
$$ \varphi \left(x,y\right)={\mathrm{tan}}^{-1}\left[\sqrt{3}\left({I}_1-{I}_3\right)/\left(2{I}_2-{I}_1-{I}_3\right)\right] $$
(4)
$$ \varPhi \left(x,y\right)=\varphi \left(x,y\right)+k\left(x,y\right)\times 2\pi $$
(5)
Equations (4)-(5) show the relationship between the wrapped phase and the absolute phase. Where k(x, y) is the order of wrapped phase.
The theory of improved ellipse binary pattern
In order to explain the principle and advantage of ellipse binary pattern, firstly the theory about sinusoidal curve will be illustrated. The sinusoidal curve distribution can be presented as:
$$ c(x)=0.5+0.5\cos \left(\frac{2\pi }{p}x\right) $$
(6)
Where c(x) ranges from 0 to 1, p is the period of every sinusoidal curve. It can be divided into a series of parts with the same pixels along x direction. As shown in Fig. 1, assuming there are N
x
equal parts in a period. The sinusoidal curve can be presented by a series of rectangles approximately. Because the input image is discrete, it can be presented as:
$$ \overline{c}(n)=\frac{1}{\omega }{\int}_{n\omega}^{\left(n+1\right)\omega}\left[c(x)\right] dx=0.5+0.5\sin c\left(\frac{\pi }{N_x}\right)\cos \left(\frac{2n+1}{N_x}\pi \right) $$
(7)
Where ω = p/N
x
which is the width of every part, and sinc(x) = sin x/x.
Based on the theory of reference [17], the meaning of Eq. (7) is that the intensity of sinusoidal curve can be presented by performing integral of area. The width of rectangle is set to have w pixels and the height is set to have h pixels. The area of every part is S = w*h. The area of every rectangle is set to S
i
(i ∈ (0, 1, 2 .. …)), then the intensity can be can calculated as Eq. (8):
$$ {I}_{out}={S}_i/S $$
(8)
When the wide stripes are used, a binary pattern is designed to get the ideal sinusoidal curve which consists of the binary ellipse pattern. This pattern is an improved technology of binary triangle fringe pattern which have proved that it has the ability to generate sinusoidal pattern [12]. Because the boundary of triangle is a straight line, the integral value is approximate linear relation. From the Fig. 2, we can find that triangle can not get perfect sinusoidal curve. Figure 2a is the triangle binary pattern, Fig. 2b is the relationship between frequency and amplitude. Figure 2c is the comparison between ideal sinusoidal curve and defocusing triangle pattern. The process of defocusing makes the intensity suffer from attenuation especially at the crest and trough.
The binary pattern is a unit which will be transformed into a sinusoidal pattern when the edge is defocused. Every unit can be expressed as I
unit
(x, y), here x and y represent the image coordinate in the projector. As shown in Fig. 3, the ellipse binary pattern consists of a series of rectangles. In a unit, the width of every rectangle is set to have W pixels and the height is set to have H pixels. Because every pixel value is discrete, the area of this part is S = W*H. If there are N1 pixels with zero intensity, the output intensity can be described by the ratio between the N1 and S. In order to get accurate intensity, we use every column as an area which means the ratio between the number of pixels in the ellipse and all the pixels in the same column can be used to present the intensity in this column.
The edge of binary unit I
unit
(x, y) is blurred along x or y direction in the high frequency. The length of every unit should be blurred based on the height of binary pattern to get an ideal sinusoidal curve. A smooth gray intensity can be gotten by defocusing technology or filter effect of binary ellipse pattern. The defocusing of ellipse along x direction can be expressed as Eq. (8):
$$ {I}_{blur}(x)={\int}_0^b{I}_{unit}\left(x,y\right) dy $$
(9)
Here x and y are the coordination of the image in the projector, b represents the length of semi-minor axis of every ellipse unit. A similar approach can be used to get the dithering pattern along y direction, as shown in Eq. 9.
$$ {I}_{blur}(y)=\underset{-a}{\overset{a}{\int }}{I}_{unit}\left(x,y\right) dx $$
(10)
Similarly, x and y are the coordination of the image in the projector and a represents the length of semi-major axis. In order to express the property by using formula, a special unit is analyzed, the semi-major axis is set to x direction and the width of this unit is a, similarly the semi-minor axis is set to y direction and the height of it is set to b, as shown in Fig. 4.
Based on the mathematical theory, the gray intensity of every pixel in the unit can be expressed as follows:
$$ I=\left\{\begin{array}{l}1\kern7.5em \frac{x^2}{a^2}+\frac{y^2}{b^2}>1\\ {}0\kern7.5em \frac{x^2}{a^2}+\frac{y^2}{b^2}\le 1\end{array}\right. $$
(11)
Here x ∈ [−a, a], y ∈ [0, b], when the improved pattern is blured horizontally, the gray intensity in each column would be the same, which can be derived using polar coordinates as follows:
$$ {I}_{blur}(x)=\left\{\begin{array}{l}x=a\cos \left(\theta \right)\\ {}y=b\sin \left(\theta \right)\end{array}\right. $$
(12)
θis the polar angle, the range is from 0 to π. In every column, the gray intensity in the vertical direction is determined as shown in Eq. (12):
$$ {I}_{blur}^0(x)=\frac{1}{b}\underset{0}{\overset{b}{\int }}{N}_{unit}\left(x,y\right) dy $$
(13)
Because the pixels are discrete quantity, the intensity can be described by the ratio between areas. The intensity can be indicated as discrete equation, as shown in Eq. (13):
$$ {I}_{blur}^0(x)=\frac{1}{b}\underset{0}{\overset{b}{\int }}{N}_{unit}\left(x,y\right) dy=\frac{1}{b}\sum_0^{b\sin \theta }{N}_{unit}\left(x,y\right) $$
(14)
To provide a concrete fringe pattern, here the semi-major axis and semi-minor axis are set a = 6 and b = 4 respectively, then the range of x direction is x ∈ [−6, 6] and the range of y direction is y ∈ [0, 4].
The process of defocusing is similar to a lens system with a 2D Gaussian function which can be represented as Eq. (15).
$$ G\left(x,y\right)=\frac{1}{2{\pi \sigma}^2}{e}^{-\left({\left(x-\overline{x}\right)}^2+{\left(y-\overline{y}\right)}^2\right)/2{\sigma}^2} $$
(15)
Where σ is the standard deviation, it determines the width of Gaussian function. For extensive defocusing, this parameter is large so that the size of filter is narrow. Based on the Eqs. (1)-(3), the output intensity can be gotten by convolution between the input image and the Gaussian function, the process can be represented as:
$$ {I}_c\left(x,y\right)={I}_{blur}^0{\left(x,y\right)}^{\ast }g\left(x,y\right) $$
(16)
Where I
c
(x, y) is the output image, g(x, y) is the Gaussian function, because Gaussian filter is isotropic, so the I
c
(x, y) can be gotten by convolution along x axis and y axis, respectively. In this paper, we use the 2D Gaussian function, so the output intensity can be calculated as:
$$ {I}_c={\left({I}_{blur}^0{\left(x,y\right)}^{\ast }g(x)\right)}^{\ast }g(y) $$
(17)
Equation (17) shows the blurred fringe pattern after the defocusing technology. The process of convolution can be presented in frequency domain. The projected sinusoidal fringes in Eqs. (1)-(3) can be presented in time domain as:
$$ {I}_P\left(x,y\right)={I}_a+{I}_m\cos \left({\omega}_0t+\varDelta \varphi \right) $$
(18)
Where I
a
is the average intensity, I
m
is the modulation intensity. ω
0 = 2π/T and T is the period of fringe pattern, Δφ is the shifted phase value. The fringe pattern can be described in frequency domain, as shown in Eqs. (19)-(21):
$$ F\left\{{I}_p\left(x,y\right)\right\}={I}_a\cdotp 2\pi \delta \left(\omega \right)+{I}_m\cdotp \pi \left[\delta \left(\omega -{\omega}_0\right)+\delta \left(\omega +{\omega}_0\right)\right]\cdotp \exp \left( j\omega \cdotp \varDelta \varphi \right) $$
(19)
$$ F\left\{g\left(x,y\right)\right\}=\exp \left(-\frac{\sigma^2{\omega}^2}{2}\right)=F\left( j\omega \right)=F\left(- j\omega \right) $$
(20)
$$ {\displaystyle \begin{array}{l}F\left\{{I}_p\left(x,y\right)\right\}\times F\left\{g\left(x,y\right)\right\}={I}_a\cdotp 2\pi \delta \left(\omega \right)\cdotp \exp \left(-\frac{\sigma^2{\omega}^2}{2}\right)\\ {}\kern14.5em +{I}_m\cdotp \pi \left[\delta \left(\omega -{\omega}_0\right)+\delta \left(\omega +{\omega}_0\right)\right]\cdotp \exp \left( j\omega \cdotp \varDelta \varphi -\frac{\sigma^2{\omega}^2}{2}\right)\end{array}} $$
(21)
By using inverse Fourier transform, the output intensity can be calculate as Eq. (22):
$$ {I}_p\left(x,y\right)={I}_a+\exp \left(-\frac{\sigma^2{\omega}^2}{2}\right)+{I}_m\cos \left({\omega}_0t+\varDelta \varphi \right) $$
(22)
In this paper, the proposed pattern need extensive defocusing but the projector can still be modeled as a 2D Gaussian function, the defocusing process is also suit to ellipse binary pattern.
Phase unwrapping
In Methods section, Eq. (4) calculates wrapped phase with the range of (−π, π). The traditional method is based on temporal phase unwrapping algorithm or spatial phase unwrapping algorithm. The aim of unwrapping phase is to get the order of every wrapped phase. We use a stair intensity image, and the period of different intensity is perfectly aligned with the period of wrapped phase.
Figure 5 demonstrates the principle. A stair image can be generated as:
$$ {I}_s\left(x,y\right)= floor\left[\left(x+P/2\right)/P\right]\times S $$
(23)
Where P represents the period of every wrapped phase. floor keeps the integral part. S is the intensity level for each stair. In order to overcome the albedo, it is necessary to normalize the intensity. The normalization process need the maximum and minimum intensity for each pixel which can be calculated as:
$$ {I}_{\mathrm{min}}\left(x,y\right)=A\left(x,y\right)-B\left(x,y\right) $$
(24)
$$ {I}_{\mathrm{max}}\left(x,y\right)=A\left(x,y\right)+B\left(x,y\right) $$
(25)
Where A(x, y) and B(x, y) can be gotten from Eqs. (1)-(3), so the stair pattern can be normalized using the following equation:
$$ {I}_s^n\left(x,y\right)=\frac{I_s\left(x,y\right)-{I}_{\mathrm{min}}\left(x,y\right)}{I_{\mathrm{max}}\left(x,y\right)-{I}_{\mathrm{min}}\left(x,y\right)} $$
(26)
The order of every wrapped phase can be gotten:
$$ k\left(x,y\right)={I}_s^n\left(x,y\right)\times \frac{R}{S} $$
(27)
In the formula, R is the intensity captured by the camera and S is the intensity level of each stair.