1 Introduction

Fringe projection profilometry [1] (FPP) is a typical 3D optical non-contact measurement method that has been widely applied in quality inspection, reverse engineering, medical systems, and other fields [2,3,4]. Numerous research studies on this method have emerged due to its high accuracy and low-cost advantages. A custom system includes a projector and a camera. Encoding fringe patterns are projected onto the object, and the deformed patterns are captured simultaneously [5]. The corresponding decoding absolute phase reflects the object's surface depth. Thus designing specific patterns is a crucial task during the measurement process. According to the pixel position information coded in the pattern, the coding methods consist of spatial and temporal coding [6]. Temporal coding methods calculate phase pixel by pixel, which can avoid effects between adjacent pixels. They can be used to measure complex surfaces and discontinuous objects [7]. Frequently used encoding methods include phase-shifting, Gray-code, and De-Bruijn coding methods. N-step phase-shifting coding is derived from phase shift interference (PSI) techniques [8], and is usually adopted for temporal phase coding. Phases are obtained by performing an inverse tangent operation on a group of varying sinusoidal patterns owing to a different fixed phase-shifting value. Calculated phases lose the period information, so they are clipped to [-π, π] which are called the wrapped phases. The corresponding fringe order information must be incorporated to acquire the absolute phases. Multiple algorithms have evolved, such as the phase-shifting Gray code, multi-frequency shift, and phase encoding methods [9,10,11]. These methods take phase-shifting codes as a basis and add additional code words or frequencies to recover the matching period for the absolute phase.

Compared with the above methods, the phase-coding technique is remarkably robust to surface contrast, ambient light, and camera disturbances, as well as for its outstanding balance between pattern numbers and accuracy of fringe order calculation. This method directly embeds the fringe order information into the N-step coding phase by uniformly quantizing the phase in a range of [0, 2π] with a stair-like, which has the same period number as the phase-shifting pattern. However, the brightness of commercial projector and the response of imaging device are usually adjusted in advance to have gamma nonlinearities in order to emulate the physics of a cathode ray tube (CRT) monitor [12]. Thus the nonlinear intensity response of the projector-camera system introduces periodic phase error that significantly affect the accuracy of fringe order calculation [13]. Since the fringe order information is encoded as a form of phase in the phase-coding method, the error brings uncertainty in determining the fringe order. Several improved methods of phase coding have been presented to solve the above problems. Luo [14] proposed a modified phase-coding method in that stair phases are embedded into five-step phase-shift sinusoidal patterns. Yang [15] utilized the special relationship among the four unconstrained patterns to calculate the fringe order. Tian [16] designed a particular coding sequence in the coding stage (0, π) to increase the number of code words. Zou [17] adopted composite cyclic grayscale values to distinguish the same cyclic codewords and integrated them into new fringe order sequences for effective phase unwrapping. Ma [18] used mathematical morphology operations to obtain fringe orders from one additional code pattern. Wu [19] presented a two-wavelength phase-shifting method in which using the long wavelength component to compute the fringe orders. Chen [20] proposed a fringe order retrieval method based on quantized phase coding and connected region labeling. They labeled the connected regions of different codes and assigned 3-digit codes between the current period and its neighbors to restore the correct fringe order. Chen [9] presented a two-digit phase-coding strategy to match the phase-shifting patterns to the two-digit codeword encoded in the phase-coding patterns.

In conclusion, the above improved phase coding methods expand the number of codewords and enhance the matching efficiency between the wrapped phase and order, sometimes in the presence of imperfections during the measurement. However, some methods require surrounding pixel information as a background to obtain the correct fringe order with a complex computation process. This operation will increase the probability of incorrect decoding and reduce the robustness of the corrected algorithm. Besides, many types of research have emerged for suppressing the nonlinear effect of the whole system [21,22,23]. Li proposed to calibrate the nonlinearity of the system by projecting pre-designed intensity patterns. Guo deduced a nonlinear phase error model and proposed an iterative pixel-by-pixel parameters compensation method. However, these methods are cumbersome and computationally complex. Meanwhile, they do not combine with specific coding methods to simplify calculation operations and improve algorithms efficiency.

This paper presents a high-accuracy and robust fringe order jump error self-correction method to directly determine the correct fringe order. Four-step shifting and coding phase are encoded separately and combined into one intensity pattern. Therefore, the wrapped phase and fringe order can be obtained simultaneously to avoid the influence of the two sets phase overlapping. Five patterns are needed during this process. Then, two auxiliary patterns are added to provide the order-located period property information. Through symbolic operations of the auxiliary patterns, the odd-evenness characteristic of the order-coded phase period is obtained. Furthermore, the theoretical analysis shows that the order calculation value for a particular period fluctuates between the ideal values of two adjacent orders under the influence of system nonlinear effect. By judging whether the corresponding wrapping phase is in an odd or even period, the fringe order can be directly corrected without sophisticated error compensation calculations.

The structure of the papers is as follows: Sect. 2 introduces the principle of the fringe order error self-correction method and an analysis of order calculation error. Section 3 reports a simulation of the proposed method under different nonlinear intensity responses. In Sect. 4, experimental results are presented, comparing the proposed method with the traditional phase-coding method to demonstrate its effectiveness and robustness. Finally, Sect. 5 provides the conclusion.

2 Principle

2.1 Traditional phase-coding method


Fringe patterns in the traditional phase coding method are classified into two groups [24], the common N-step shifting phase and the pixel-by-pixel matching order-coding phase, as shown in Fig. 1. The periods of the two sets patterns are the same. The intensities of four-step phase-shifting pattern are represented as:

$$I_{n} (x,y) = A + B\cos (\varphi (x,y) + 2\pi (n - 1)/4)$$
(1)

where n = 1,2,3,4. A and B are the ambient light and fringe modulation. (x, y) denotes the camera image pixel. φ is the wrapped phase reflecting the profile of the object to be measured. Define phase shift \(\delta_{n} = 2\pi (n - 1)/4\).

Fig. 1
figure 1

Principle of the traditional phase coding method

According to the least-square algorithm, the wrapped phase is expressed as:

$$\varphi (x,y) = \arctan \frac{{\sum {I_{n}^{c} } (x,y)\sin \delta_{n} }}{{\sum {I_{n}^{c} } (x,y)\cos \delta_{n} }}$$
(2)

The wrapped phase loses the matched period information. To recover the absolute phase, corresponding order-encoded patterns are designed as:

$$I_{n}^{s} (x,y) = A + B\cos (\alpha (x,y) + \delta_{n} )$$
(3)

The cue of fringe order is successively embedded in the coding phase as the stair phase, presented as follows:

$$\alpha (x,y) = {\text{floor}}\left( \frac{x}{h} \right) \times \frac{2\pi }{N}$$
(4)

where h is the number of pixels per fringe period. N is the number of fringe periods. The function floor () is the down-round function.

Similarly, α is the stair phase that can be calculated as

$$\alpha (x,y) = \arctan \frac{{\sum {I_{n}^{s} } (x,y)\sin \delta_{n} }}{{\sum {I_{n}^{s} } (x,y)\cos \delta_{n} }}$$
(5)

Thus, the fringe order can be obtained. Where round () represents the rounding function.

$$m(x,y) = {\text{round }}(N \times \alpha (x,y)/2\pi )$$
(6)

Then the absolute phase Φ(x, y) can be calculated according to the fringe order m(x, y) and the wrapping phase φ(x, y).

$$\Phi (x,y) = \varphi (x,y) + 2\pi \times m(x,y)$$
(7)

2.2 Fringe order error self-correction method

The intensity of captured patterns depends on digital light processing rather than the object. Thus, when the received intensity is distorted, the fringe order calculated from the received intensity operation will be affected. Many factors influence the captured image intensity and cause errors. The significant error comes from the nonlinear intensity response of the digital projector-camera optical system [25]. It results in non-sinusoidal waveforms for the captured fringe patterns, causing the additional phase calculation error for widely employed phase-shifting algorithms [26]. Ae Ref [27] mentioned, the phase error due to saturation also has the same characteristics as nonlinearity. Thus, the additional phase calculation error under the influence of luminance saturation is similar to that of system nonlinearity.

To remove the order calculation error generated by system luminance nonlinearity, a self-correction method is proposed to retrieve the correct order directly. The procedure of the proposed method is described in Fig. 2. Five patterns in the first row are used for calculating the wrapped phase and corresponding fringe order pixel-by-pixel accurately. The wrong fringe order occurs under the system’s nonlinear effect. The two patterns in the second row provide the order period property. Distorted phase fringe order sequence can be corrected with a self-correction strategy. The erroneous stair phase floats near the ideal value but not exceeds the last and next period’s ideal value. Because each adjacent period has different parity features, by distinguishing the located period property and assigning the correct number directly, the wrong fringe order can be self-rectified directly and quickly.

Fig. 2
figure 2

Principle of the proposed method

The traditional four-step phase-shifting phase-coding method requires projecting eight patterns during the measurement. In order to improve accuracy while reducing the number of patterns, a composite phase coding method is presented. This coding method separately encodes the four-step shifting and coding phases into the same pattern, avoiding overlap between the two phase sets during decoding calculation. Moreover, the wrapped phase and fringe order are achieved at the same time. The composite phase-coding patterns are expressed as follows:

$$I_{i}^{c} (x,y) = \left\{ {\begin{array}{*{20}c} {A + 0.5B\cos (\varphi (x,y) + 2\pi (i - 1)/4) + 0.5B\cos (\alpha (x,y) + 2\pi (i + 1)/4)\begin{array}{*{20}c} {} & {i = 1 - 4} \\ \end{array} } \\ {A - 0.5B\sin (\alpha (x,y)) - 0.5B\cos (\alpha (x,y))\begin{array}{*{20}c} {} & {i = 5} \\ \end{array} } \\ \end{array} } \right.$$
(8)

where A and B are the ambient light and fringe modulation. φ(x, y) represents the wrapped phase. α(x, y) represents the stair phase. Figure 3 shows the intensity distributions of one cross section for the designed patterns sequentially.

Fig. 3
figure 3

The intensity of one cross section for designed patterns sequentially

The wrapped phase can be calculated from the following form:

$$\varphi (x,y) = \arctan \frac{{I_{2}^{c} (x,y) - I_{4}^{c} (x,y)}}{{I_{3}^{c} (x,y) - I_{1}^{c} (x,y)}}$$
(9)

The coding phase is calculated in a similar way to the wrapped phase. Fringe order m(x, y) and absolute phase Φ(x, y) can be calculated the same as Eqs. (6)–(7).

$$\alpha (x,y) = \arctan \frac{{I_{1}^{c} (x,y) + I_{3}^{c} (x,y) - 2I_{5}^{c} (x,y)}}{{I_{2}^{c} (x,y) + I_{4}^{c} (x,y) - 2I_{5}^{c} (x,y)}}$$
(10)

The nonlinear intensity response of the projector-camera system deviates from its ideal distribution, leading to periodic errors in the calculation of fringe order information encoded as a form of phase. Hence false fringe order calculation are more likely to occur. However, the fringe order error can be self-corrected with the help of order-located period property information. To this end, we generate two additional patterns based on the second and fourth fringe with π phase shifts of adjacent periods. The intensities of two patterns are expressed as follows:

$$I_{6}^{c} (x,y) = \left\{ {\begin{array}{*{20}l} {A + 0.5B\sin (\varphi (x,y)) - 0.5B\sin (\alpha (x,y))} \hfill & {\,\bmod \,[{\text{floor }}(x/h),2] = 0} \hfill \\ {A - 0.5B\sin (\varphi (x,y)) - 0.5B\sin (\alpha (x,y))} \hfill & {\,\bmod \,[{\text{floor }}(x/h),2] = 1} \hfill \\ \end{array} } \right.$$
(11)
$$I_{7}^{c} (x,y) = \left\{ {\begin{array}{*{20}l} {A - 0.5B\sin (\varphi (x,y)) - 0.5B\sin (\alpha (x,y))} \hfill & {\bmod \,[{\text{floor}}(x/h),2] = 0} \hfill \\ {A + 0.5B\sin (\varphi (x,y)) - 0.5B\sin (\alpha (x,y))} \hfill & {\bmod \,[{\text{floor}}(x/h),2] = 1} \hfill \\ \end{array} } \right.$$
(12)

Auxiliary phase φi(x,y) can be obtained as

$$\varphi_{i} (x,y) = \arctan \frac{{I_{6}^{c} (x,y) - I_{7}^{c} (x,y)}}{{I_{3}^{c} (x,y) - I_{1}^{c} (x,y)}}$$
(13)

The basic phase φ(x,y) in Eq. (9) and the above auxiliary phase φi(x,y) have different distributions in the odd or the even period. The two phases have equal values in the odd period, and in the even period, the two phases have exactly opposite values.

To distinguish the properties of the period in which the phase is located, define S(x,y) as the sign operation of two phases.

$$S(x,y) = \left\{ {\begin{array}{*{20}c} {{\text{sign}}\left[ {\varphi (x,y) \times \varphi_{i} (x,y)} \right]} & {\varphi (x,y) \ne 0\& \varphi_{i} (x,y) \ne 0} \\ {{\text{sign}}\left[ {\varphi (x + 1,y) \times \varphi_{i} (x + 1,y)} \right]} & { \, else \, } \\ \end{array} } \right.$$
(14)

The result of the symbol operation can reflect the phase period characteristic. Thus, the fringe order of the corresponding wrapped phase can be self-corrected directly. The procedure for fringe order self-correction is summarized as follows. Figure 4 shows the detailed steps for this process.

Fig. 4
figure 4

Flow chart of phase order self-correction

Step 1: The camera captures the modulated seven projected patterns. Calculate wrapped phase φ(x,y) in Eq. (9), coding phase α(x,y) in Eq. (10), auxiliary phase φ(x,y) in Eq. (13) and sign operation S(x,y) in Eq. (14) pixel by pixel.

Step 2: Record the number of adjacent periods for the order-located period of stair phase: n and (n + 1).

Step 3: When S(x,y) equals 1. If n is odd, the order here is rectified to (n + 1). If n is even, the order here is n.

When S(x,y) is equal to  – 1, if n is odd, the order here is n. Otherwise, if n is even, rectify the order here to (n + 1).

2.3 Order calculation error analysis


The system nonlinearity factor introduces errors in the fringe order decision. The intensity of a non-sinusoidal pattern is usually modeled as suffering from gamma distortion [28]. In this paper, the intensity distribution of the captured pattern is expressed as follows:

$$I = I_{0} + I_{1} \cos \varphi + I_{1} \cos \alpha$$
(15)

where I0 and I1 are corresponding ambient light and fringe modulation. φ and α represent the wrapped phase and the stair phase. Considering the gamma effect, the intensity distribution of the captured distorted pattern is expressed as

$$\begin{gathered} I^{\gamma } = \left( {I_{0} + I_{1} \cos \varphi } \right)^{\gamma } \sum\limits_{m = 0}^{\infty } {\left[ {\frac{\gamma (\gamma - 1) \cdots (\gamma - m + 1)}{{m!}}\cos^{m} \alpha } \right]} \\ = I_{0}^{\gamma } \sum\limits_{m = 0}^{\infty } {\left[ {\frac{\gamma (\gamma - 1) \cdots (\gamma - m + 1)}{{m!}}\cos^{m} \varphi \times \cos^{m} \alpha } \right]} \\ \end{gathered}$$
(16)

With the power theorem of the cosine function, the above formula can be simplified as follows:

$$I^{\gamma } = I_{0} + I_{1} \cos \varphi + I_{1} \cos \alpha + \sum\limits_{k = 2}^{\infty } {I_{k} } \times \cos (k \times \varphi ) \times \cos (k \times \alpha )$$
(17)

According to Eq. (10), erroneous stair phase can be calculated as follows:

$$\begin{gathered} \alpha ^{\prime} = \arctan \frac{{I_{1}^{c\gamma } (x,y) + I_{3}^{c\gamma } (x,y) - 2I_{5}^{c\gamma } (x,y)}}{{I_{2}^{c\gamma } (x,y) + I_{4}^{c\gamma } (x,y) - 2I_{5}^{c\gamma } (x,y)}} \\ = \arctan \frac{{Bsin\alpha - \sum\limits_{k = 2}^{\infty } {B_{k} } \times \sin (k \times \alpha ) \times \cos (k \times \alpha )}}{{Bcos\alpha^{\prime } - \sum\limits_{k = 2}^{\infty } {B_{k} } \times \sin (k \times \alpha ) \times \cos (k \times \alpha )}} \\ = \arctan \frac{{2B\sin \alpha - \sum\limits_{k = 2}^{\infty } {B_{k} } \times \sin (2k \times \alpha )}}{{2B\cos \alpha - \sum\limits_{k = 2}^{\infty } {B_{k} } \times \sin (2k \times \alpha )}} \\ \end{gathered}$$
(18)

The result in Eq. (18) is the sum of the ideal stair phase and stair phase error. Therefore, the stair phase error can be calculated as the following:

$$\begin{gathered} \Delta \alpha = \arctan \frac{{\tan \alpha^{\prime } - \tan \alpha }}{{1 + \tan \alpha^{\prime } \tan \alpha }} \\ = \frac{{B_{2} \times \sin 4\alpha \times (\cos \alpha + \sin \alpha )}}{{2B - B_{2} \times \sin 4\alpha \times (\cos \alpha + \sin \alpha ) - B_{3} \times \sin 6\alpha \times (\cos \alpha + \sin \alpha )}} \\ \end{gathered}$$
(19)

According to k. Liu et al. [29], the relationship between Bk+1 and Bk can be expressed as:

$$\frac{{B_{k + 1} }}{{B_{k} }} = \frac{\gamma - k}{{\gamma - k + 1}}$$
(20)

Thus, the stair phase error can be represented as:

$$\begin{gathered} \tan \Delta \alpha = \frac{\sin 4\alpha \times (\cos \alpha + \sin \alpha )}{{\frac{{(\gamma + 2)^{2} }}{\gamma (\gamma - 1)} - \sin 4\alpha \times (\cos \alpha + \sin \alpha ) - \frac{\gamma - 2}{{\gamma + 3}} \times \sin 6\alpha \times (\cos \alpha + \sin \alpha )}} \\ < \frac{\sin 4\alpha \times \gamma (\gamma - 1)}{{(\gamma + 2)^{2} }} \ll \alpha \\ \end{gathered}$$
(21)
$$\begin{gathered} \Delta \alpha = \tan \Delta \alpha - \frac{{\tan \Delta \alpha^{3} }}{3} + \frac{{\tan \Delta \alpha^{5} }}{5} - \frac{{\tan \Delta \alpha^{7} }}{7} + \ldots \\ \approx \tan \Delta \alpha < \alpha_{\min } = \frac{2\pi }{N} \\ \end{gathered}$$
(22)

The characteristic of the stair phase error is observed in Fig. 5. We can see that the wrong fringe order of the particular period lies between the ideal phase value of the last and next period under the influence of the system’s nonlinearity.

Fig. 5
figure 5

Distribution of the stair phase and fringe order

3 Fringe order self-correction simulation

Simulation is conducted to confirm the efficiency of the proposed fringe order self-correction method. In this section, we set three conditions. The first condition is the existence of luminance nonlinearity. The second condition is the existence of random noise with luminance nonlinearity. The third condition is the existence of luminance saturation and random noise with luminance nonlinearity. Patterns have a resolution of 500 500 pixels with a period of 35 pixels.

3.1 Simulation under different nonlinear intensity responses

γ described in Eq. (16) simulates the different nonlinear intensity responses of the digital projector-camera optical system. γ is set from 0.5 to 2.5 by an interval of 0.5 except for 1. The intensity distribution is express as follow:

$$I_{1} (x,y) = (0.5 + 0.25\cos (\varphi (x,y)) + 0.25\cos (\alpha (x,y)))^{\gamma }$$
(23)

Figure 6 proves the whole process visually. The pattern intensity under the system intensity impact of different gamma value is shown in the first row. The intensity distribution is non- sinusoidal, introducing high-frequency sinusoidal harmonics. The second row shows the relatively ideal and distorted stair phase, i.e., the case with system nonlinearity. It's discovered that the calculated stair phase fluctuates around the ideal phase but does not exceed the ideal phase values of the previous and the next period. Accordingly, the shown fringe order calculation in the third row has some deviation values fluctuating from  – 1 to 1. After applying the fringe order self-correction strategy, the corrected order is shown in the fourth row. It is observed that the false order values are eliminated, and the robustness of the phase unwrapping process is promoted. The results confirm that the proposed fringe order error self-correction algorithm can efficiently remove the effect of nonlinearity on the fringe order decision and give the correct value directly without complex computation.

Fig. 6
figure 6

Theoretical simulation diagram. (1) Pattern intensity under the impact of system intensity. (2) Errorneous and ideal stair phase. (3) Errorneous and ideal fringe order. (4) Corrected fringe order

3.2 Simulation under different noise level

In the second simulation, we fixed the gamma value as 1.5 and added the random noise with Gaussian distribution to the pattern. the noise has a mean of zero and a standard deviation ranging from 0.01 to 0.04 by an interval of 0.01.i.e. σnoise = [0.01:0.01:0.04]. The intensity distribution is expressed as follows:

$$I_{1} = (0.5 + 0.25\cos (\varphi (x,y)) + 0.25\cos (\alpha (x,y)))^{1.5} { + }\sigma_{{{\text{noise}}}}$$
(24)

Figure 7 proves the whole process visually. The pattern intensity under the influence of different random noise level with system intensity is shown in the first row. The intensity distribution appears obvious burr superposition with the increase of noise standard deviation. The second row shows the relatively ideal and distorted stair phase. It's discovered that the calculated stair phase fluctuates around the ideal phase which has the same characteristic as the first simulation. Accordingly, the shown fringe order calculation in the third row has some deviation values fluctuating from  – 1 to 1. After applying the fringe order self-correction strategy, the corrected order is shown in the fourth row. It is observed that the false order values are totally removed.

Fig. 7
figure 7

Theoretical simulation diagram. (1) Pattern intensity under the impact of random noise with system intensity. (2) Errorneous and ideal stair phase. (3) Errorneous and ideal fringe order. (4) Corrected fringe order

3.3 Simulation under different saturation level

In the third simulation, we fixed the gamma value as 1.5 and the standard deviation of noise as 0.01. We added the saturation coefficient S to simulate the luminance saturation which ranges from 1.1 to 1.7 by an interval of 0.2. The intensity distribution is expressed as follows:

$$I_{1} = \left\{ {\begin{array}{*{20}c} {S \times (0.5 + 0.25\cos (\varphi (x,y)) + 0.25\cos (\alpha (x,y)))^{1.5} { + }\sigma_{{{\text{noise}}}} \begin{array}{*{20}c} {} & {I_{1} < 1} \\ \end{array} } \\ {\begin{array}{*{20}c} {} & {} & {\begin{array}{*{20}c} {\begin{array}{*{20}c} {} & {} & {} & {} \\ \end{array} } & {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} {} & {} & 1 & {} \\ \end{array} } & {} & {} & {} \\ \end{array} } & {} & {} & {\begin{array}{*{20}c} {} & {} & {I_{1} > 1} & {} \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right.$$
(25)

Figure 8 proves the whole process visually. The pattern intensity under the influence of different luminance saturation level with random noise and system intensity is shown in the first row. The intensity distribution significantly suffers from saturation with the increase of saturation coefficient. i.e. the intensity is limited to1. The second row shows the relatively ideal and distorted stair phase. It's discovered that the calculated stair phase fluctuates around the ideal phase but does not exceed the ideal phase values of the previous and the next period. Accordingly, the shown fringe order calculation in the third row has some deviation values fluctuating from -1 to 1 which has the same characteristic as the first simulation. After utilizing the fringe order self-correction strategy, the corrected order is shown in the fourth row. It is found that the false order values can also be totally eliminated.

Fig. 8
figure 8

Theoretical simulation diagram. (1) Pattern intensity under the impact of luminance saturation with random noise and system intensity. (2) Errorneous and ideal stair phase. (3) Errorneous and ideal fringe order. (4) Corrected fringe order

These simulation results confirm that the proposed fringe order error self-correction algorithm can efficiently remove the effect on the fringe order decision where random noise and luminance saturation exist simultaneously in addition to luminance nonlinearity. At the beginning of the measurement, we can check the intensity distribution of the captured pattern. When the captured intensity of pattern image distorts from the sinusoidal distribution due to the nonlinearity of the detector or intensity saturation, it will cause wrong fringe order calculation results. At this time, the proposed method is effective to this situation. The fringe order value can be self-corrected directly without complex computation.

4 Experiment

An FPP system was constructed to demonstrate the performance of this novel method. The system contains a DLP projector with a resolution of 1140 × 912 and a camera with a resolution of 2048 × 1088. The pixel depth of the camera is 8 bits. The focal length of the lens is 16 mm. The projector and camera were horizontally positioned on the optical platform, which were placed about 450 mm in front of the tested objects. Two experiments were designed to prove the validity and accuracy performance of the proposed method. The period of all generated patterns was 15 pixels. Both the traditional and proposed method were applied to measure a flat board regarded as the reference plane and two isolated objects in front of the board. The intensity distribution of the captured patterns distorts under the impact of system nonlinearity and the calculation of the absolute phase map will be affected accordingly. To demonstrate the effectiveness of the proposed method for different degrees of system nonlinearity’s effect, set the captured camera image gamma coefficient to 0. 9, 1.2, 1.5. We verify that the absolute phase fringe order can be efficiently corrected with the help of the self-correction method directly.

Seven generated patterns based on the proposed method and eight patterns based on the traditional phase-coding method were projected to measure the same flat board in the first experiment. The reference plane patterns were recorded by the camera. The fringe order and absolute phase of the reference plane were recovered according to the corresponding decoded method. A 500 × 500 pixels region was extracted to analyze the performance of the two methods. Figure 9 shows the captured patterns of the reference plane at the different image gamma coefficients.

Fig. 9
figure 9

Captured patterns of the reference plane. ac Proposed phase coding fringes. d–f Traditional phase coding fringes at the gamma coefficient of 0. 9, 1.2, 1.5

The calculated fringe order of the 100th column is shown in Fig. 10. The first row displays the results under the traditional phase encoding method. Obviously, under the system nonlinearity impact, the distorted fringe order no longer follows a flat stepwise growth path but with frequent jumps distributed randomly. The number of wrong fringe order points increases with the deepening of the nonlinear degree. The error jump is from  – 1 to 1, demonstrating the theoretical proof of fringe order error in the above section. The wrapped phase and auxiliary phase results are shown in Fig. 11. We can see that the two set phases have the same distribution in the odd property period but the opposite distribution in the even property period. Thus, the period of a particular order can be located. After applying the self-fringe order correction strategy, the corresponding corrected absolute phase period order is shown in the second line. The order jump error is totally removed regardless of the degree of nonlinear influence.

Fig. 10
figure 10

The fringe order calculation results of the 100th column. ac Traditional phase coding method under the nonlinear effect. df Proposed phase coding method under the nonlinear effect

Fig. 11
figure 11

During the proposed phase coding method, ac The wrapped phase results. df The auxiliary wrapped phase results of the 100th column under the nonlinear effect

The fringe order diagrams and distributions on one cross section of the traditional and self-corrected phase-coding are shown in Fig. 12. Due to received distorted intensity, the traditional method fringe orders have error transitions that incorrectly identify the fringe orders. In contrast, the proposed method can correct the all-wrong orders and directly retrieve the orders map without the complex algorithm.

Fig. 12
figure 12

The fringe order diagram. (1) Traditional phase coding method under the nonlinear effect. (3) Proposed phase coding method under the nonlinear effect. The order distribution on one cross section (2) Traditional phase coding method under the nonlinear effect. (4) Proposed phase coding method under the nonlinear effect

The corresponding absolute phase reconstruction results and distributions on one cross section of the flat board are shown in Fig. 13. There are several jump error points compared to the surrounding orders because the fringe order calculated by the traditional method is misaligned, which does not correctly match the wrapped phase's exact position. Thus, the object reconstructed by the phase-coding method has apparent errors due to the jump errors. The accuracy of reconstruction results decreases and the error points increase with the deepening of the system’s nonlinear effect. In comparison, the error points can be wholly eliminated with the proposed self-correction method, which indicates the robustness of the method in restoring the absolute phase map.

Fig. 13
figure 13

The reconstructed absolute phase of the flat board. (1) Traditional phase coding method under the nonlinear effect. (3) Proposed phase coding method under the nonlinear effect. The distribution on one cross section (2) Traditional phase coding method under the nonlinear effect. (4) Proposed phase coding method under the nonlinear effect

In the second experiment, a complex scene including two isolated resin dolls in front of the boars was measured to validate the effectiveness of the proposed self-correction algorithm. The captured camera image gamma coefficient here is 1.2. We set the camera exposure time as 0.2 s and 0.5 s. Figure 14(1-a)-(1-b) show the measured scene and a captured image under the exposure time of 0.2 s. Figure 15 (1-a)–(1-b) show the measured scene and a captured image under the exposure time of 0.5 s. The arrangement of these two figures have the same meaning distribution. We compared the measurement results between the proposed and traditional phase-coding methods. Part (2-a)–(2-d) show the diagram and one cross section of the fringe order. It is evident that under the system's nonlinear influence, unpredictable error points exist using the traditional method during the fringe order calculation. Under the luminance saturation with nonlinearity, The number of phase error points becomes more. However, the proposed method can automatically correct the order error and retrieve the correct order fast. Part (3-a)–(3-d) show the unwrapped phase before and after error correction. The distorted absolute phase diagram has many irregular fuzzy points caused by incorrect order calculation. This result will seriously affect the effect of surface reconstruction. While these points can be removed after self-correction.

Fig. 14
figure 14

(1-a) The measured scene under the exposure time of 0.2 s. (1-b) one of the captured images. The fringe order diagram under system nonlinearity (2-a) using traditional phase-coding method. (3-a) using proposed method. The unwrapped phase diagram under system nonlinearity (2-c) using traditional phase-coding method. (3-c) using proposed method. The fringe order distribution in one cross Sect. (2-b) using traditional phase-coding method. (2-d) using proposed method. The unwrapped phase distribution in one cross Sect. (3-b) using traditional phase-coding method. (3-d) using proposed method

Fig. 15
figure 15

(1-a) The measured scene under the exposure time of 0.5 s. (1-b) one of the captured images. The fringe order diagram under luminance saturation and nonlinearity (2-a) using traditional phase-coding method. (3-a) using proposed method. The unwrapped phase diagram under same condition (2-c) using traditional phase-coding method. (3-c) using proposed method. The fringe order distribution in one cross section (2-b) using traditional phase-coding method. (2-d) using proposed method. The unwrapped phase distribution in one cross section (3-b) using traditional phase-coding method. (3-d) using proposed method

The reconstructed 3D shapes of isolated objects under two exposure times are shown in Figs. 16 and 17. The reconstructed surface appears to have many abrupt error points, resulting in poor recovery accuracy. It has more error points under the impact of luminance saturation with nonlinearity. While using the proposed method for object reconstruction, two reconstructed surfaces are both smooth and continuous, and there are no obvious wrong jumping points. By comparing the reconstruction effect, it is evident that the proposed self-correction order error method can eliminate the fringe order error where random noise and luminance saturation exist simultaneously in addition to system nonlinearity and achieve more accurate profile reconstruction.

Fig. 16
figure 16

The reconstructed 3D shape under the exposure time of 0.2 s. a With traditional phase-coding method. b With proposed method. The order distribution of one cross-section. c With traditional phase-coding method. d With proposed method

Fig. 17
figure 17

The reconstructed 3D shape under the exposure time of 0.5 s. a With traditional phase-coding method. b With proposed method. The order distribution of one cross-section. c With traditional phase-coding method. d With proposed method

5 Conclusion

In this paper, a self-correction method for fringe order jump error based on the phase-coding method is presented to directly determine the correct fringe order. The system’s nonlinear intensity response deviates from the original intensity distribution. It brings the jump error to the fringe order calculation, eventually leading to reconstruction errors. The proposed method can automatically locate the odd-evenness of the erroneous order period and directly correct the fringe order jump error caused by system nonlinearity. The method works well where random noise and luminance saturation exist simultaneously in addition to system nonlinearity. Compared to the traditional phase coding method, our method compensates for the drawback that fringe order is easily affected by system nonlinearity while maintaining the original advantages. The proposed method has good anti-noise capability and robustness, effectively improving measurement accuracy based on phase-coding. In addition, the number of projected patterns is reduced by one, so that the measurement speed is increased. Simulation and experimental results verify the performance of the proposed method in terms of its high- precision 3D reconstruction.