1. Introduction
As an important contactless optical metrology technique, fringe projection profilometry (FPP) based on the structured light technique has continuously attracted much attention from scholars in recent years [
1,
2,
3]. FPP possesses the merits of offering fast speed and high accuracy such that it has been applied in various fields, such as reverse engineering, biomedical engineering, and online detection [
4,
5,
6]. A typical FPP system consists of a projector used to project the designed patterns and a camera used to capture the deformed fringes. Three-dimensional (3D) geometry of the tested objects can be derived from the deformed images. Phase-shifting is more accurate and robust in comparison with a transform-based algorithm and is broadly used to retrieve phase maps in FPP [
7]. However, a phase-shifting algorithm usually requires three or more fringe patterns to complete measurements, which limits its measuring efficiency [
8]. Accordingly, color phase-shifting profilometry (CPSP) has been proposed to address these issues. CPSP frequently uses a three-step phase-shifting method since it requires the least number of projected patterns, and it encodes them into R (red), G (green), and B (blue) channels to form one color image, which allows the simultaneous acquisition of three phase-shifting patterns to realize one-shot measurement [
9].
Generally, a color imaging device has no colorblind areas on the spectrum; due to the spectra of R, G, and B, the channels are usually made to have some overlap [
10]. Unfortunately, this induces crosstalk between the three different channels. The coupling effects can distort the intensities of the captured patterns and introduce nonlinear phase errors in the final phase map [
11]. A detailed analysis of the nonlinearity in CPSP is described in
Section 2.2. To eliminate the errors caused by color coupling or crosstalk, many nonlinear correction methods have been proposed. Kinell [
12] introduced a direct method to compensate for the errors. The R, G, and B channels were calibrated individually, and the difference between distorted phases and reference phases was used to establish a look-up table (LUT) for compensation. Huang et al. [
13] calculated the modulation degrees of the R, G, and B channels, respectively. The coefficients between the three different channels were determined and used to compensate for nonlinear errors. Zhang et al. [
14] introduced a CPSP method using extra images to compute the distorted curves to correct the errors and reserved the color information of the object. Wan et al. [
15] proposed an active phase error suppression method for color phase-shifting fringe projection based on hue precorrection. Wu et al. [
16] presented a point-to-point method based on the correspondence between camera pixels and projector pixels to accomplish the compensation of the full field. However, those methods require extra images with prior knowledge to calculate the compensation factors, which means that once the measuring condition changes, the calibration process is repeated.
Additionally, some methods without calibration have also been proposed. Hu et al. [
17] estimated a color demixing matrix based on the color fringe patterns captured from a reference plane or the surface of an object without extra images. Ma et al. [
18] presented a blind phase error suppression approach based on isotropic n-dimensional fringe pattern normalization and carrier squeezing interferometry. Flores et al. [
19] implemented a pattern normalization algorithm to achieve the intensity modulation balance and an iterative algorithm to retrieve the phase. Naturally, the methods described above take more time to complete the calculations. Alternatively, Wang et al. [
20] first applied the Hilbert transform to CPSP and improved the measurement accuracy with little computation. However, the Hilbert-transform-based method is sensitive to sharp edges or discontinuous parts. Thus, methods without calibration usually require complex calculations or strict working conditions.
This paper proposes a nonlinear error compensation method for CPSP with histogram equalization. The proposed method eliminates the phase errors without a calibration process or additional images. Meanwhile, the calculation is also simple, which has a positive effect on the measuring speed. Generally, a histogram of an undistorted phase is uniform, but that of a distorted phase becomes nonuniform. Thus, the distorted phase can be corrected by directly applying histogram equalization. Accordingly, the first step is directly applying histogram equalization to the wrapped phase, and the nonlinear phase error caused by crosstalk can be compensated for roughly. Then, a spline interpolation optimization is implemented to further eliminate the discretization error and smooth the phase. The simulations and experiments validate the efficiency of the proposed method.
3. Simulations
Some simulations were conducted to verify the performance of the proposed nonlinear error correction method. The simulated color fringe pattern had 400 × 600 pixels with a fringe period of
pixels.
Figure 2a shows the ideal pattern without any distortions. As described above, color crosstalk was regarded as the main factor for inducing nonlinear error in this paper. Therefore, in the following simulations, the gamma value was set as
, and the color crosstalk matrix
of the system was set as [
18]:
To simulate the random noises, Gaussian white noise with a zero mean and a standard deviation of 0.02 was added to the simulated patterns. In addition, to simulate the defocus blur, a Gaussian filter with a size of 5 × 5 pixels and a standard deviation of 2.0 was also applied to the simulated pattern.
Figure 2b shows the distorted pattern with color crosstalk, random noises, and defocus blur. The wrapped phases of the ideal and distorted patterns were calculated separately with a three-step phase-shifting algorithm, as shown in
Figure 2c,d. Clearly, the ideal phase presented excellent linearity in contrast to the distorted phase presenting significant nonlinearity. Then, the PPDs of the ideal and distorted phases were computed as illustrated in
Figure 2e,f. Clearly, the PPD of the ideal phase was uniform; in contrast, the PPD of the distorted phase was very nonuniform. Finally, we applied the
histeq MATLAB function with
on the distorted phase to adjust its PPD and correct the nonlinear error.
Figure 2g illustrates the adjusted PPD, and
Figure 2h shows the corrected phase. It is obvious that the adjusted PPD became much more uniform than the distorted PPD, but still with slight unevenness, to which the combination with random noises led. The corrected phase had very good linearity that was very approximate to the ideal phase. The minor residual error may be caused by the PPD unevenness and random noises. The simulation results demonstrated that the proposed method can effectively reduce the nonlinear error introduced by color crosstalk.
Different objects were considered in the following simulations. The resolution of the simulated images was 800 × 800 pixels, and other parameters remained unchanged. Two spheres, each with a radius of 150 pixels, were generated, and the distance between the two spheres was 100 pixels. The deformed images of the spheres by the ideal color pattern and the distorted color pattern are shown in
Figure 3a and
Figure 3b, respectively. Then, we recovered the absolute phase.
Figure 4a shows the absolute phase retrieved from the distorted image without any corrections. To verify the necessity of spline fitting in the proposed method, we recovered the phase map using partial content of the proposed method, that is, the histogram equalization and the whole proposed method, respectively.
Figure 4b shows the phase obtained utilizing only histogram equalization, and
Figure 4c shows the phase recovered with the whole proposed method. The absolute phase obtained with the ideal image was regarded as the reference; thus, three error maps corresponding to
Figure 4a–c, as shown in
Figure 4d–f, were calculated. The root mean square (RMS) errors of the mentioned results were 0.1554 rad, 0.0704 rad, and 0.0511 rad, respectively. Obviously, the first step of the proposed method, the histogram equalization, was to correct the nonlinear error. However, the first step could induce a discretization error. To further improve the accuracy, the second step, a spline fitting algorithm, was presented to eliminate the discretization error. The error maps shown in
Figure 4e–f conclude that the spline fitting algorithm was necessary in the proposed method, and the proposed method had a good performance for removing nonlinear errors.
Secondly, a single, continuous, step height object was generated. The simulated parameters were the same as mentioned above. The necessity of spline fitting in our method was validated in the first simulation. In this simulation, the effectiveness of the proposed method in dealing with objects with cliff edges was verified. Similarly, we recovered the phase map using the normal unwrapped algorithm and the proposed method.
Figure 5a shows the absolute phase obtained without nonlinear error elimination, and its surface had serious ripple errors. In contrast, the results recovered with the proposed method had smooth surfaces, as illustrated in
Figure 5b. The ground truth of the step height is shown in
Figure 5c.
Figure 6 illustrates the cross-section of the recovered results and the ideal phase of the step height. The line marked in red is the distorted phase, and the information is unavailable for comparison to the ideal one. Apparently, nonlinear errors in the CPSP influenced the measuring results, and the surface information of the measured object was lost in errors. However, for the corrected one marked in green, the results were very close to the ideal one, and the surface was clearly presented. It can be seen from
Figure 5 and
Figure 6 that the proposed method guaranteed the measuring accuracy of CPSP.
To explore the influence of the number
on the correction results, the residual errors under different
values were computed.
Figure 7a illustrates the nonlinear error before PPD adjustment within one fringe period, and the RMS error was about 0.192 rad.
Figure 7b–f illustrate the residual errors after PPD adjustment with different
values, and the corresponding RMS errors are also given. Further,
Figure 8 plots the RMS error curve of the residual errors with respect to different
values ranging from 50 to 1000. In particular, the RMS residual error decreased to 0.061 rad when
, 0.041 rad when
, 0.033 rad when
, 0.032 rad when
, and 0.031 rad when
. It is obvious that the RMS residual error was inversely proportional to
. If
, the RMS residual error degraded quickly from 0.061 to 0.032 rad with the increase of
. If
, the RMS residual error stayed stable with the increase of
, only having a variation of 0.001 rad. The simulation results confirmed that the residual error can be restrained by choosing a relatively larger
value. However, a larger
value always requires higher computation cost; thus,
was selected in the following experiments.
4. Experiments
A typical FPP system consisting of a digital-light-processing (DLP) projector and a complementary metal oxide semiconductor (CMOS) camera was built. The DLP projector was a Light-Crafter 4500 with a resolution of 912 × 1140 pixels. The camera was a Basler a2A1920-160ucBAS with a resolution of 1920 × 1200 pixels. The objects were perpendicular to the camera at a distance of 60 cm. The color-encoded fringes were sequentially projected onto the measured objects using the projector, and the camera simultaneously captured the deformed images. The pitch of the stripe was 18 pixels. The wrapped phase was recovered with the three-step phase-shift algorithm [
24].
To validate the performance of the proposed method, a sculpture with a simple surface was measured first. The captured image is shown in
Figure 9a. Its corresponding wrapped phase was calculated using the three-step phase-shift algorithm, and its absolute phase was obtained utilizing the multifrequency method. The reconstruction results are shown in
Figure 9b. Obviously, severe ripple errors induced by crosstalk occurred on the surface. To validate the necessity of spline fitting in a real-world scenario, we also recovered the surface with only the first step of the proposed method, and the results are shown in
Figure 9c. The final result obtained with the whole proposed method is illustrated in
Figure 9d. As it can be seen in
Figure 9b–d, the result obtained with the first step of the proposed method had some slight ripple errors, and the nonlinearity errors were effectively eliminated in comparison to the distorted one. Moreover, compared with the former two results, there were almost no errors on the surface that was recovered by the whole proposed method. We concluded, the same as the results obtained in the simulation, that spline fitting is necessary and effective in our method. For the sake of clarity,
Figure 10 illustrates the cross-section of the recovered results of the sculpture. Obviously, the final result was smoother than both the distorted result and the result obtained with the first step of the proposed method. It is important to point out that the proposed method capably corrected the nonlinear errors, and the two steps of the method were indispensable.
In the next experiment, we measured a white fish with slightly complex surfaces.
Figure 11a shows the deformed image of the fish. For normal multifrequency unwrapped algorithms, the recovered absolute phase had obvious errors, as shown in
Figure 11b. The results illustrated in
Figure 11c obtained with our proposed method had smooth surfaces. Experiments in a real-world scenario showed that the proposed method could improve the measurement effectiveness of CPSP and could be utilized for more color-encoded fringe-based applications.
5. Discussions and Conclusions
The accuracy of color phase-shifting profilometry (CPSP) is limited because of nonlinear errors caused by color coupling [
25]. This paper proposed a simple and efficient method based on histogram equalization to address this issue. Compared with Refs. [
12,
13,
14], the proposed method did not require any precalibrated operations to obtain the relationship between the distorted pixels and the ideal ones. Compared with Ref. [
16], the proposed method did not need any extra images to obtain more distorted information for correction. Although the proposed method possesses the aforementioned advantages, it has its own limitations. The proposed method corrected the nonlinear errors based on histogram equalization, and its accuracy hinged on the amount of data at a certain degree. The larger the number of data, the higher the accuracy. Moreover, this limitation can be addressed by using a phase-shifted wrapped phase [
26]. Overall, the proposed method accurately enhanced the measurement speed of CPSP.
An effective method was presented in this paper for color crosstalk correction. The proposed method contained two main steps. The first was to correct the crosstalk using histogram equalization. Second, a spline fitting algorithm was implemented to remove the discretization error induced by the histogram equalization operation. Obviously, compared with other compensation methods, the proposed approach did not require any precalibration information or additional patterns and simplified the correction without a loss of efficiency. The simulations and experiments clearly showed that this proposed method efficiently solved the nonlinear error problem. The proposed method expands applications of CPSP. Meanwhile, the proposed method provides a hint about how to eliminate errors using the characteristics of fringes on one hand. On the other hand, it provides a clue to correct errors in other scenarios (e.g., dynamic errors, etc.) with histogram equalization.