## 2 Principle
### Gray Imbalance Correction Method  
In the actual measurement process, these demodulated monochrome phase shifting deformed patterns have problems of gray imbalance due to the existences of sensitivity differences and color crosstalk among the three color channels, as mentioned in the Introduction, seriously affecting the measuring accuracy; thus, it is necessary to correct the above three-frame monochromatic deformed patterns. The existences of sensitivity differences and color crosstalk are mainly generated by the inconsistency of white balance and spectral mismatch between the digital projector and CMOS camera. Therefore, the monochrome phase shifting deformed patterns demodulated by the captured single frame of color deformed pattern are used for coefficient compensation to make the three-frame monochrome phase shifting deformed patterns intensity distribution map closer to the same. The coefficient compensation method is proposed. First, the intensity of one component of the three-frame demodulated monochromatic deformed patterns is selected as the reference, and the other two components are multiplied by a compensation coefficient to make the intensity of the three components basically the same. Taking the green component as the benchmark here, the three-frame corrected monochrome deformed patterns are expressed as:  
\[\left\{ \begin{array}{l}I_{RM}(x,y)=K_{GR}*(I_{R}(x,y)-I_{G0}+B_{GRP})+I_{G0} \\ I_{GM}(x,y)=I_{G}(x,y)\\ I_{BM}(x,y)=K_{GB}*(I_{B}(x,y)-I_{G0}+B_{GBP})+I_{G0}\end{array} \right. \tag{7}\]  
where \(I_{RM}(x,y)\), \(I_{GM}(x,y)\), and \(I_{BM}(x,y)\) represent the intensity distribution diagrams of the tricolor channels after correction. \(K_{GR}\) and \(K_{GB}\) are the compensation coefficients, \(B_{GRP}\) and \(B_{GBP}\) are the offsets of the zero phase point of the monochromatic phase shifting deformed pattern, and \(I_{G0}\) is the intensity value of the zero phase point of the green component. They can be expressed as:  
\[ \begin{array}{l}K_{GR}=\frac{\sum\limits_{x=1}^{M}I_{RPEAKS}(y)}{\sum\limits _{x=1}^{M}I_{CPEAKS}(y)}\\ K_{GB}=\frac{\sum\limits_{x=1}^{M}I_{BPEAKS}(y)}{\sum\limits_{x=1}^{M}I_{CPEAKS }(y)}\\ B_{GRP}=\frac{\sum\limits_{x=1}^{M}\sum\limits_{y=1}^{N}(I_{G}(x,y)-I_{R}(x,y ))}{M\times N}\\ B_{GBP}=\frac{\sum\limits_{x=1}^{M}\sum\limits_{y=1}^{N}(I_{G}(x,y)-I_{B}(x,y ))}{M\times N}\\ I_{G0}=\frac{\sum\limits_{x=1}^{M}\sum\limits_{y=1}^{N}I_{G}(x,y)}{M\times N} \end{array}  \tag{8}\]  
where \(I_{RPEAKS}(y)\), \(I_{CPEAKS}(y)\), and \(I_{BPEAKS}(y)\), respectively, represent the average of the peak values of each cycle of the row of monochromatic phase shifting deformed patterns of the tricolor channels. \(M,N\) are the height and width of the image. In the proposed measurement method, the numerator in the calculated truncated phase (Equation (6)) is the sum of the two components of the red and blue channels. According to Equation (5), it can be seen that the designed quadrature color composite grating has a phase shifting between the components in the red and blue channels, and the half sum of these components should be the background image, as shown in Equation (9):  
\[I_{RB0}=(I_{RM}+I_{BM})/2=A(x,y) \tag{9}\]Due to the existence of sensitivity differences and color crosstalk in the color deformed pattern, the half sum of the red and blue components may show volatility to some extent. According to the method of low-pass filtering, the Fourier spectrum of \(I_{RB0}(x,y)\) is acquired by Fast Fourier Transform. Through Gaussian filtering window, the zero-frequency components can be extracted by filtering out higher-order harmonic components of that Fourier spectrum. Then, this zero-frequency component is transformed by inverse Fourier transform to get a \"uniform light field\" \(I_{RB1}(x,y)\) which is closer to the actual value. Due to the influence of filtering, the high-frequency energy is removed and some errors are introduced. To reduce the error caused by filtering, a gray imbalance correction method based on the DC component's consistency approximation is proposed.