Expand this Topic clickable element to expand a topic
Skip to content
Optica Publishing Group

Incremental PCA algorithm for fringe pattern demodulation

Open Access Open Access

Abstract

This work proposes a new algorithm for demodulating fringe patterns using principal component analysis (PCA). The algorithm is based on the incremental implantation of the singular value decomposition (SVD) technique for computing the principal values associated with a set of fringe patterns. Instead of processing an entire set of interferograms, the proposed algorithm proceeds in an incremental way, processing sequentially one (as minimum) interferogram at a given time. The advantages of this procedure are twofold. Firstly, it is not necessary to store the whole set of images in memory, and, secondly, by computing a phase quality parameter, it is possible to determine the minimum number of images necessary to accurately demodulate a given set of interferograms. The proposed algorithm has been tested for synthetic and experimental interferograms showing a good performance.

© 2022 Optica Publishing Group under the terms of the Optica Open Access Publishing Agreement

1. Introduction

Principal component analysis (PCA) is a multivariate technique for data analysis [1,2] that allows determining whether and how data from a given dataset are correlated. From a dataset table composed of N observations of M variables, PCA computes a linear transform of these variables into a set of $L \le N$ “principal components” which describes accurately the data variation. Therefore, PCA determines how the set of N observations are correlated and reduces the data complexity by keeping the most relevant linear combination of the original variables. PCA has many applications in fields such as finance [3], neuroscience [4,5], bioinformatics [6,7], machine learning [8], and image processing [915].

PCA has been successfully applied to the problem of fringe pattern demodulation using the phase-shifting technique [1318]. In this application, the data corresponds to N images (fringe patterns or, simply, interferograms), each one converted into a column vector of M elements (pixels), assuming a constant phase jump between any pair of interferograms. The application of PCA to this dataset results in two significant principal components: the sine and the cosine of the interferogram phase. Therefore, the interferogram phase can be extracted through an arctangent operation.

Phase-shifting PCA presents some advantages: Firstly, it is fast; secondly, it does not require an initial guess of the phase-steps, which may even be randomly distributed. Thirdly, it shows good noise-rejection properties even for noisy or low contrast interferograms [19,20]. Recent improvements in the application of phase-shifting PCA are the application of VU factorization to deal with varying background illumination and uneven distribution of phase jumps [21], the use of Fourier analysis for improving the algorithm performance [22], and an enhanced phase-shifting PCA based on a robust weighted PCA technique [23].

One of the drawbacks of phase-shifting algorithms (including PCA) is that noisy or low contrast interferograms, usually require processing a significant number of images to get the desired accuracy in the phase retrieval. This leads to storing a considerable amount of data in the computer memory for large images. This issue is compounded by the fact that usually, it is not possible to know, a priori, the optimum number of images necessary to determine the phase map with the required accuracy, and thus, this number may be over or underestimated. Finally, current PCA phase-shifting algorithms are not well suited for “on the fly” phase demodulation, as they require taking a large number of images before processing them.

In this paper, we propose to implement an incremental phase-shifting PCA technique to address some of the issues listed before. Used in conjunction with a parameter that indicates the quality of the retrieved phase map, the incremental algorithm proposed here can stop once the requested phase retrieval accuracy is achieved, avoiding, in this way, processing more images than necessary. Therefore, the proposed algorithm allows for “on the fly” demodulation, which may be interesting for applications such as quality control or remote sensing. We checked the technique with both synthetic and experimental interferograms to show the feasibility of our proposed approach.

The rest of the paper is organized as follows. Next, we present the theoretical foundations of the technique. Afterward, we apply the method to both synthetic and experimental interferograms showing the goodness of the algorithm. Finally, conclusions are drawn at the end of the paper.

2. Theoretical foundations

For the sake of completeness, we first summarize the phase-shifting PCA algorithm [1314] in the next subsection. Then, we introduce the proposed incremental phase-shifting PCA approach. In the following, matrices will be represented by bold-typeface uppercase letters, either Latin or Greek, vectors by bold-typeface lowercase letters, and scalars by letters (upper- or lowercase) with the standard typeface.

2.1 Standard phase-shifting PCA algorithm

The starting point of the phase-shifting PCA algorithm is a set of N interferograms with a given phase-shift between any pair of them. Mathematically, each interferogram is described by a matrix, ${{\boldsymbol I}_{\; k = 1,2, \ldots ,N}}$, being

$${{\mathbf I}_k} = b + m\cos ({{\mathbf \Phi } + {\delta_k}} ),$$
where b is the background, m the modulation, ${\mathbf \Phi }$ the phase of the interferogram (assumed as stationary), and ${\delta _k} \in [{0,2\pi } ]$ the phase-shift. An additive noise may also be present. Notice that the standard phase-shift PCA algorithm requires that the phase-shifts, $\{{{\delta_k}} \}$, should be spread enough to cover the whole interval $[{0,2\pi } ]$; otherwise, errors may arise. However, unlike other phase-shifting algorithms, the phase-shifts are not required to be equispaced or evenly distributed to provide accurate results. Thus, the PCA phase-shifting demodulation is an asynchronous approach.

The first step of the standard phase-shifting PCA algorithm is grouping the data in a matrix ${\mathbf X}$ defined as

$${\mathbf X} = [{{{\mathbf i}_1},{{\mathbf i}_2},{{\mathbf i}_3}, \ldots ,{{\mathbf i}_N}} ],$$
where, ${{\mathbf i}_k}$ is a column vector formed by concatenating the columns of ${{\mathbf I}_k}$. Thus, the dimensions of ${\mathbf X}$ are $M \times N$ where M is the number of elements (pixels) of a given interferogram. ${\mathbf X}$ is the data matrix of the PCA problem, with N measurements of M parameters being each pixel a parameter as for the standard PCA terminology. Notice that, for fringe pattern processing, ${\mathbf X}$ is always a real matrix.

Next step, we have the background suppression. Notice that we can subtract the mean computed column-wise, or the mean computed row-wise. The former one is equivalent to a spatial average along all the pixels of the image, while the latter one is equivalent to a temporal average [18]. In this work, we will use the temporal average as it is more effective for noise suppression so that we will rewrite matrix ${\mathbf X}$ as

$${\mathbf X} = [{{{\tilde{{\mathbf i}}}_1},{{\tilde{{\mathbf i}}}_2},{{\tilde{{\mathbf i}}}_3}, \ldots ,{{\tilde{{\mathbf i}}}_N}} ],$$
where ${\tilde{{\mathbf i}}_k} = {{\mathbf i}_k} - {\boldsymbol{\mathrm{\mu}} }$, being $\boldsymbol{\mathrm{\mu}} = \mathop \sum \nolimits_k {{\mathbf i}_k}/N$ the temporal average of the fringe patterns. Notice that complete suppression of the background term can only be achieved, as for any asynchronous method, using equispaced phase jumps in the interval $[{0,2\pi } ]$ so that $\epsilon = \mathop \sum \nolimits_j \cos {\delta _j} \approx \mathop \sum \nolimits_j \sin {\delta _j} \approx 0.$ Otherwise, a phase error may arise. It can be shown that this error goes with ${\epsilon ^2}$. In our experience, using more than five images reduces this error significantly.

The goal of the PCA algorithm is to determine a linear transformation that converts the correlation matrix ${\mathbf C} = {{\mathbf X}^\textrm{T}}{\mathbf X}$ (where $\textrm{T}$ stands for the transpose operator) into a non-zero positive-defined diagonal matrix, ${\mathbf \Lambda }$, with eigenvectors $\{{{\sigma_1},{\sigma_2}, \ldots {\sigma_N}} \}$ ordered in increasing order, so that, ${\sigma _1} > {\sigma _2} \ldots > {\sigma _N}$. In general, the first $L < N$ eigenvectors of matrix ${\mathbf \Lambda }$, are enough to describe the data variation accurately.

To compute ${\mathbf \Lambda }$, we will start with the singular value decomposition (SVD) of matrix ${\mathbf X}$

$${\mathbf X} = {\mathbf{US}}{{\mathbf V}^\textrm{T}}$$
where ${\mathbf U}$ is a $M \times N$ orthogonal matrix, ${\mathbf S}$ is a $N \times N$ diagonal matrix, and ${\mathbf V}$ is a $N \times N$ orthogonal matrix. In these conditions
$${{\mathbf X}^\textrm{T}}{\mathbf X} = {({{\mathbf{US}}{{\mathbf V}^\textrm{T}}} )^\textrm{T}}({{\mathbf{US}}{{\mathbf V}^\textrm{T}}} )= {\mathbf V}{{\mathbf S}^2}{{\mathbf V}^\textrm{T}}.$$
Therefore, ${\mathbf \Lambda } = {{\mathbf S}^2}$, and the projection
$${\mathbf F} = {\mathbf{XV}} \equiv {\mathbf{US}},$$
projects the data matrix ${\mathbf X}$ into a matrix ${\mathbf F}$ whose columns are the left singular vectors of ${\mathbf X}$ multiplied by the corresponding singular value. The columns of ${\mathbf F}$ are the principal components of the data matrix ${\mathbf X}$. The advantage of the principal component analysis is that if we restrict ourselves to the most significant principal components, namely, the first $L < N$ columns of matrix F, we have that
$$\hat{{\mathbf X}} = \hat{{\mathbf F}}{\hat{{\mathbf V}}^\textrm{T}},$$
where $\hat{{\mathbf F}}$ is the $M \times L$ matrix formed by the first L columns of matrix ${\mathbf F}$, and $\hat{{\mathbf V}}$ is the $N \times L$ matrix formed by the first L columns of matrix ${\mathbf V}$. It can be shown [1,2] that $\hat{{\mathbf X}}$ is a good linear approximation to the data matrix, ${\mathbf X}$, so the dimensions of the original data set are effectively reduced.

When PCA is applied to phase-shifted interferograms, it can be demonstrated [13,14] that there are only two statistically significant principal components so, in this case, $L = 2$, and $\hat{{\mathbf F}} = [{{{\mathbf f}_1},\; {{\mathbf f}_2}} ]$ where ${{\mathbf f}_{1,2}}$ are column vectors with M elements. Moreover, as it is shown in Refs. [13,14]., after arranging these first principal components as matrices, ${{\mathbf F}_{1,2}}$, with the same dimension of the interferograms, we have that [13,14]

$$\begin{array}{c} {{{\mathbf F}_1} = m\cos ({\mathbf \Phi } ),}\\ {{{\mathbf F}_2} ={-} m\sin ({\mathbf \Phi } ).} \end{array}$$
Therefore, we can extract the wrapped phase through an arctangent operation.
$${{\mathbf \Phi }_w} = \arctan \left( {\frac{{ - {{\mathbf F}_2}}}{{{{\mathbf F}_1}}}} \right),$$
where both the arctangent and quotient operation are applied element-wise. The arctangent operation should be implemented in a similar way to Matlab’s ‘atan2’ function to avoid uncertainties in the recovered phase. In these circumstances, ${{\mathbf \Phi }_w} \in [{ - \pi ,\pi } ]\; \textrm{is a wrapped phase so},\; {{\mathbf \Phi }_w} = {\mathbf \Phi } - \pi {\mathbf \Phi }/\pi $, where $\left\lfloor {} \right\rfloor$ stands for the floor function.

2.2 Incremental phase-shifting PCA algorithm

The standard phase-shifting PCA algorithm presented above has some limitations. Firstly, to accurately demodulate noisy or low contrast fringe patterns, a relatively high number of images ($N \approx 20$) is required. According to Levy and Lindenbaum [24], the complexity of the standard PCA algorithm is $O({M{N^2}} )$ and it requires the storage of $O({MN} )$ memory units. With current image sizes in mind ($M \approx 5\cdot{10^6}\; \textrm{pixels}$), the standard phase-shifting PCA should process a large number of data ($MN \approx {10^8}$ bytes). In some cases, this may affect the performance of the algorithm, being even possible to get a computer memory overload. However, the capabilities of modern computers overcome this disadvantage to some extent. Secondly, it is impossible to know, a priori, the exact number of images required to demodulate some fringe pattern. To overcome these problems, we propose an incremental PCA algorithm coupled with a quantitative parameter to determine the goodness of the phase demodulation process.

In the literature, some incremental PCA algorithms have been proposed in the past [2426]. The workflow of these algorithms is similar: they start with a matrix, ${\mathbf Y}$, formed by the first $R$ columns of matrix ${\mathbf X}$, Obviously, $R$ should be equal or greater than the number of statistically relevant principal components, so $R \ge L$. After applying PCA to matrix ${\mathbf Y}$ we obtain a first approximation to the principal components. This approximation is refined by sequentially processing the remaining columns of ${\mathbf X}$. Notice that not all of these incremental algorithms are suited for processing large amount of data, such as images. For example, the algorithm of Lippi et al. [25] requires the computation of $M \times M$ matrices. For a typical high resolution image of a 5 megapixel camera, this would computation of $2.5\cdot{10^{13}}$ bytes matrices, in uint8 precision, which is clearly not feasible.

In this work, we have selected the algorithm of Levy and Lindenbaum [24], which is suited for large images. However, there is a fundamental change in our implementation of Levy’s algorithm in how we perform background subtraction. In the work of Levy and Lindenbaum background suppression is performed individually for each image, this is equivalent to subtracting the spatial average, as commented before. However, we have found that, for the problem of fringe pattern processing, it is more effective, for noise suppression, to subtract the temporal average. In the standard PCA algorithm, given the data matrix ${\mathbf X} = [{{{\mathbf i}_1},{{\mathbf i}_2}, \ldots ,{{\mathbf i}_N}} ]$, spatial averaging is equivalent to subtracting the mean computed column-wise while temporal averaging implies subtracting the mean row-wise. Therefore, for the standard PCA algorithm, both spatial and temporal averaging can be implemented indistinctively. However, for the temporal PCA algorithm, to compute the temporal average we need to update sequentially the mean vector, so we have modified Levy and Lindenaum algorithm accordingly. Therefore, the algorithm proposed can be summarized in the following steps.

  • 1) Initialization:
    • (a) We start forming a matrix Y whose columns are the first R interferograms of the set converted into column vectors and staked so that ${\mathbf Y} = [{{{\mathbf i}_1},{{\mathbf i}_2}, \ldots ,{{\mathbf i}_R}} ]$. In the proposed phase-shifting application, we will set $R = 3$ for reasons we will disclose later.
    • (b) Determine the mean vector ${\boldsymbol{\mathrm{\mu}}_\textrm{R}} = \mathop \sum \nolimits_{j = 1}^R {{\mathbf i}_j}/R$ and subtract background to obtain ${\mathbf Y} = [{{{\mathbf i}_1} - {\boldsymbol{\mathrm{\mu}}_\textrm{R}},{{\mathbf i}_2} - {\boldsymbol{\mathrm{\mu}}_\textrm{R}}, \ldots ,{{\mathbf i}_R} - {\boldsymbol{\mathrm{\mu}}_\textrm{R}}} ]$
    • (c) Compute the SVD decomposition of ${\mathbf Y}$ so that ${\mathbf Y} = {{\boldsymbol U}_0}{{\mathbf S}_0}{\mathbf V}_0^\textrm{T}$ and keep matrices ${{\mathbf U}_0}$ (dimensions $M \times R$) and ${{\mathbf S}_0}$ (dimensions $R \times R$)
  • 2) Main loop, kth stage: For each new interferogram, ${{\mathbf I}_k}$, with $k$ starting at $R + 1$, we proceed as follows:
    • (a) Form a column vector, ${{\mathbf i}_k}$, by concatenating the columns of ${\hat{{\mathbf I}}_k}.$ Update the mean vector as ${\boldsymbol{\mathrm{\mu}}_k} = ({({k - 1} ){\boldsymbol{\mathrm{\mu}}_{k - 1}} + {{\mathbf i}_k}} )/k$. Then subtract the background so ${\tilde{{\mathbf i}}_k} = {{\mathbf i}_k} - {\boldsymbol{\mathrm{\mu}}_k}$.
    • (b) Form the matrix ${{\mathbf A}_{k - 1}} = [{{\mathbf U}_{k - 1}}{{\mathbf S}_{k - 1}}|{\tilde{{\mathbf i}}_k}]$ with dimensions $M \times ({R + 1} )$. For the first step of the loop ($k = R + 1$), ${{\mathbf A}_R} = [{{\mathbf U}_0}{{\mathbf S}_0}|{\tilde{{\mathbf i}}_{R + 1}}]$.
    • (c) Compute the QR [24] decomposition of the matrix ${{\mathbf A}_{k - 1}}$ so that ${{\mathbf A}_{k - 1}} = {\mathbf U}_{k - 1}^\prime{\mathbf S}_{k - 1}^\prime$ being ${\mathbf U}_{k - 1}^\prime$ a column orthogonal matrix with dimensions $M \times ({R + 1} )$ and ${\mathbf S}_{k - 1}^\prime$ an upper triangular matrix with size $({R + 1} )\times ({R + 1} )$.
    • (d) Calculate the SVD decomposition of ${\mathbf S}_{k - 1}^\prime = {\tilde{{\mathbf U}}_{k - 1}}{\tilde{{\mathbf S}}_{k - 1}}{{\mathbf V}^\textrm{T}}$, and remove the last row and column of the matrix ${\tilde{{\mathbf S}}_{k - 1}}$ to get an $R \times R$ diagonal matrix, ${{\mathbf S}_k}$
    • (e) Remove the last column of the matrix ${\tilde{{\mathbf U}}_{k - 1}}$ to get an $({R + 1} )\times R$ column orthogonal matrix, ${\hat{{\mathbf U}}_{k - 1\; }}$, and compute the matrix ${{\mathbf U}_k} = {\mathbf U}_{k - 1}^\prime\hat{{\mathbf U}}_{k - 1}^\textrm{T}$
    • (f) Start the next iteration of the loop using matrices ${{\mathbf S}_k}$ and ${{\mathbf U}_k}$ computed in steps d) and e), respectively.
  • 3) Final result: After processing all the interferograms, the final result is the principal component matrix ${{\mathbf F}_N} = {{\mathbf U}_N}{{\mathbf S}_N}$ with dimensions $M \times R$. The wrapped phase is extracted from the first two columns of ${{\mathbf F}_N}$ using Eqs. (8) and (9).
The main difference with the algorithm published in [24] is the temporal background subtraction and the fact that we have neglected a scalar multiplicative factor (called $ff$ in this reference) which multiplies matrix ${{\mathbf A}_{k - 1}}$ in the step b) of the main loop. We have found, from the results of the numeric simulations, that, in our application, we can always set $ff$ as 1. Also, in the algorithm presented before, we process one column at a time, but it is possible to add any number of columns as shown in [24].

2.3 Determining the minimum number of interferograms

One of the advantages of the incremental phase-shifting PCA algorithm is that it demodulates the phase using the exact number of interferograms needed to get the desired accuracy. For this, it is necessary to use some quality parameter that determines the goodness of the phase demodulation. In Ref. [19], the following phase error indicator is proposed

$$\gamma = \sqrt {{{\left( {\frac{{{\sigma_1}/{\sigma_2} - 1}}{{10}}} \right)}^2} + {{\left( {\frac{{{\sigma_3}}}{{{\sigma_1} + {\sigma_2} - 2{\sigma_3}}}} \right)}^2}} $$
Where ${\sigma _1}$, ${\sigma _2}$ and ${\sigma _3}$ are the first three eigenvalues of matrix ${\mathbf \Lambda }$, notice that this is why we set $R = 3$ in the initialization step of the algorithm, to ensure that ${\mathbf \Lambda }$ is a $3 \times 3$ matrix so we can obtain the first three eigenvalues to compute the phase error indicator. Therefore, we can add one step to the main loop of the algorithm as
  • g) Compute the parameter γ using Eq. (10) from the main diagonal elements of the matrix ${{\mathbf \Lambda }_k} = {\mathbf S}_k^T{{\mathbf S}_k}$, and, if this parameter is lower than a prefixed value, finish the loop and compute the resulting matrix ${{\mathbf F}_k} = {{\mathbf U}_k}\cdot{{\mathbf S}_k}$ to extract the wrapped phase.
The introduction of this step allows setting a maximum permissible error, ${\gamma _0}$, before processing the images, so the algorithm stops when the desired accuracy is achieved (in our experience, good results are obtained for ${\gamma _0} = 0.1$, or ${\gamma _0} = 10\; \% $, when expressed as a percentage), that is when $\gamma \le {\gamma _0}$. In this way, the algorithm's performance is increased, as it only processes the exact number of images necessary to achieve the desired accuracy. Alternatively, instead of setting a maximum permissible error, it is also possible to check the variation of the parameter γ between iterations of the algorithm, and stop the algorithm if the variation of γ slows significantly, or if the error parameter, γ, rises.

In the next section, we will show the results obtained when we applied our algorithm to both simulated and experimental interferograms.

3. Experimental results

3.1 Numerical simulations

To check the feasibility of the proposed algorithm, we have carried out first a numerical simulation. We have generated a set of N = 20 synthetic fringe patterns with low modulation ($m = 0.15$) and high uniform noise ($SNR\; = \; 25$) as shown in Fig. 1. Notice that, in this work, we define the signal to noise ratio as $SNR = {b^2}/\sigma _\eta ^2$, where ${\sigma _\eta }$ is the noise standard deviation. The size of the fringe patterns is $512 \times 512$ pixels with 256 gray levels, so $M = {512^2} = 262144$ pixels. Each fringe pattern presented a random global phase shift, comprised within the interval $[{ - \pi ,\pi } ]$ rad. We have demodulated this set of fringe patterns using the standard PCA demodulation algorithm and the proposed incremental technique.

 figure: Fig. 1.

Fig. 1. First, a), and last, b), interferogram of the sequence employed to test the proposed incremental PCA algorithm. Both interferograms present low contrast, $m\; = \; 0.15$, and high uniform noise, $SNR\; = \; 5$, with a random phase shift between them.

Download Full Size | PDF

We will first present the results obtained with the standard PCA demodulation algorithm in Fig. 2. We have depicted in 2a) and 2b) the first and second principal components, ${{\boldsymbol F}_1}$ and ${{\boldsymbol F}_2}$, respectively, and the phase obtained after applying Eq. (9) in Fig. 2(c)). The actual phase (wrapped) is represented in Fig. 2(d)). As we can see, the PCA algorithm can demodulate properly even low contrast, noisy fringe patterns as the ones shown in Fig. 1.

 figure: Fig. 2.

Fig. 2. Results obtained after applying the standard PCA algorithm a) first and b) second principal component, c) demodulated wrapped phase and d) original wrapped phase. Notice that the algorithm has been able to demodulate correctly the phase. Still, the resulting phase map presents noise due to the noisy input fringe patterns, like those shown in Fig. 1.

Download Full Size | PDF

Next, we show the results of applying the proposed incremental algorithm. In Fig. 3, we present the algorithm's evolution by depicting the demodulated phase after processing 5, 10, 15, and, finally, 20 fringe patterns of the set using the incremental PCA algorithm. As expected, the result, after processing the whole set of fringe patterns with the incremental algorithm (Fig. 3(d)), is similar to that obtained using the standard PCA algorithm (Fig. 2(c)). However, the incremental PCA only needs to store at least two fringe patterns in the computer memory, while the standard algorithm should store the whole set.

 figure: Fig. 3.

Fig. 3. Phase demodulation with the incremental PCA algorithm after processing a) 5, b) 10, c) 15, and d) 20 fringe patterns of the set. Notice that the demodulated phase after processing the whole set of fringe patterns is similar to the phase depicted in Fig. 2(d)).

Download Full Size | PDF

Regarding performance, the incremental PCA carries out the demodulation of the entire set of $512 \times 512$ fringe patterns in 0.31 seconds, while the standard PCA algorithm employs a similar time of 0.32 seconds. In both cases, we use a computer with an Intel Core i7-8700 CPU with 32 Gb of RAM installed and a graphics card NVidia GeForce GTX 1050 with 1Gb of memory, running Matlab 2020a in Windows 10. The code employed can be found in Code 1, Ref. [27].

We have also compared our method to a robust PCA-based phase demodulation technique [28], especially suited for precise phase retrieval under harsh conditions. In Fig. 4 we show the results obtained after processing the whole set of 20 interferograms. We can see that the roust PCA method retrieves the phase with less error than incremental PCA but, as this method requires to compute an extended set of interferograms, the computation time rises to 38.8 seconds, a hundred-fold increment.

 figure: Fig. 4.

Fig. 4. a)Phase demodulated with the incremental PCA algorithm after processing 20 fringe patterns. b) Phase demodulated using the robust PCA-based algorithm described in Ref. [28].

Download Full Size | PDF

Besides the advantage of not storing at the same time the whole set of fringe patterns in the computer memory, the incremental PCA algorithm has the advantage of “on the fly” demodulation. This means, among other things, that we can stop the algorithm before processing the whole set of fringe patterns once we reach an acceptable demodulation result. For example, as we can see in Fig. 3, after processing 15 interferograms, the visual aspect of the demodulated phase (Fig. 3(c)) is quite similar to that after processing the whole set of 20 interferograms (Fig. 3(d)). Therefore, we need to define some parameter that gives us a quantitative indicator of the quality of the phase demodulation. In this way, we can process a set of fringe patterns until the quality parameter reaches a fixed value, avoiding, in this way, processing more fringe patterns than the necessary minimum to achieve the desired result.

As said before, in this work we will use the quality parameter proposed by Vargas et al. [19], and defined in Eq. (10). To show the evolution of this parameter, we have carried out another simulation in which we have demodulated three sets of synthetic fringe patterns corresponding to the same phase distribution depicted in Fig. 2(d)), but with different values of contrast and SNR. The first set is formed by noisy (SNR = 25) and low contrast (c = 0.15) fringe patterns, the same case of Figs. 12, and 3. The second set consists of fringe patterns with medium contrast, c = 0.3, and a moderate SNR of 50. Finally, the last pattern set is formed by high-contrast (c = 0.6) fringes with negligible noise (SNR = 75). Each set contains 40 images, and we have demodulated them using the proposed incremental PCA algorithm. The demodulation results are shown in Fig. 5

 figure: Fig. 5.

Fig. 5. Demodulation results of three different sets of fringe patterns using the proposed incremental PCA algorithm. a) The first set formed by low-contrast and noisy fringe patterns, b) the second set formed by average-contrast and average-noise fringe patterns, and c) the third set formed by high-contrast and low noise fringe patterns. Notice that a global phase jump may exist between the recovered wrapped phase maps.

Download Full Size | PDF

As shown in Fig. 5, the algorithm successfully demodulated the three sets, obtaining a cleaner phase map for the high-contrast, low noise set, as expected. We have also computed the fringe pattern modulation computed as $m = \sqrt {{{\mathbf F}_1} + {{\mathbf F}_2}} $ where ${{\mathbf F}_1}$ and ${{\mathbf F}_2}$ are the significant principal components used to compute the phase in Eq. (9). The resulting modulation maps are plot in Fig. 6. Although these maps should show a uniform modulation, a double-frequency distortion appears. This distortion is linked to the fact that the sum $\mathop \sum \nolimits_n^N \cos {\delta _n}\sin {\delta _n}$ is not exactly zero, as assumed by the general phase-shifting PCA algorithm [14], which produces an error in the modulation that goes as $\sin ({2{\mathbf \Phi }} )$, hence the double-frequency distortion. The recovered phase also present this structure as we can see in Fig. 7, where we have represented the differences between the computed wrapped phase and the theoretical one used to generate the fringe patterns (also wrapped). Despite this structure, the RMS error diminishes as the SNR increases, as expected from the plots of Fig. 5, and the value of this magnitude is around 0.003 rads.

 figure: Fig. 6.

Fig. 6. Modulation of the three different sets of fringe patterns demodulated with the proposed incremental PCA algorithm for the three levels of SNR and contrast defined in Fig. 5. Notice that a double-frequency ripple distortion that appears due asynchronous nature of the phase-shifting PCA method

Download Full Size | PDF

 figure: Fig. 7.

Fig. 7. Difference between the wrapped phase demodulated with the proposed incremental PCA algorithm and the exact wrapped phase for the three levels of noise and contrast described in Fig. 5. Notice that a double-frequency ripple distortion that appears due asynchronous nature of the phase-shifting PCA method

Download Full Size | PDF

We have plotted in Fig. 8 the evolution of the phase-error indicator defined in Eq. (10), expressed as a percentage, against the number of iterations. We can see that, in general, the parameter tends to decrease with the number of images. However, while the evolution of the quality parameter is smooth for noisy fringe patterns, when the noise diminishes, the quality parameter presents oscillations, particularly for the low-noise, high-contrast interferograms depicted as green diamonds in Fig. 8. This behavior indicates that processing more images than necessary for such low-noise fringe patterns does not improve the quality of the phase recovered. For example, when SNR = 75 and c =0.6, the quality parameter reaches a minimum after processing ten images. We have checked that the phase map recovered after processing ten images is the same as the one depicted in Fig. 4(c)), obtained after processing 40 images. Therefore, a good strategy for implementing the quality parameter could be processing fringe patterns until the quality parameter reaches a local minimum value, avoiding, in this way, processing more images than necessary.

 figure: Fig. 8.

Fig. 8. Evolution of the phase-error indicator against the number of iterations for three sets of synthetic fringe patterns with the same phase but different contrast and noise. The triangles correspond to low-contrast (c = 0.35), high noise (SNR = 40), the squares to medium-contrast (c = 0.5) average noise (SNR = 80) and the diamonds to high-contrast (c = 0.7), low-noise (SNR = 240) patterns. Notice the decrement of the phase-error indicator value with the increasing number of iterations.

Download Full Size | PDF

3.2 Experimental results

Next, we will show the results obtained when we have applied our algorithm to demodulate experimental fringe patterns. In Fig. 9, we present the first and last image of a set of N = 19 interferograms whose size is $600 \times 800$ pixels, thus $M = 4.8\cdot{10^5}$ pixels. There is a fixed phase shift, not known in advance, between each pair of interferograms of this sequence. We can see that these interferograms present medium contrast with moderate noise. For this example, the interferograms are masked. However, this is not a problem for either the incremental or the standard PCA demodulation algorithms.

 figure: Fig. 9.

Fig. 9. First, a) and last b) fringe pattern of the sequence corresponding to an interferometric experiment. There is a global phase jump between these interferograms, otherwise identical.

Download Full Size | PDF

We have demodulated this set of interferograms with both the standard and incremental PCA algorithms. We have computed in both cases the evolution of the quality parameter, $\gamma $, or phase-error indicator, against the number of processed interferograms. In Fig. 10, we present this evolution plot showing that, in both cases, the quality parameter evolves similarly.

 figure: Fig. 10.

Fig. 10. Evolution of the quality parameter as a function of the number of images processed for the set of experimental interferograms depicted in Fig. 7. We can see a similar evolution for the incremental PCA (blue squares) and the standard (red triangles) algorithms.

Download Full Size | PDF

In Fig. 11(a)) we show the result after demodulating this fringe pattern set with the proposed incremental PCA algorithm, while the result obtained after applying the standard PCA algorithm is depicted in Fig. 11(b)). The result of Fig. 11(a)) has been obtained after processing 14 images, for which the Phase-error indicator of Fig. 10) reached a value lower than the threshold ${\gamma _0} = 10\; \% $. At the same time, the phase map depicted in Fig. 11(b)) has been obtained after processing the whole set of $N = 17$ fringe patterns. We can see a good agreement between the two methods, but it is noticeable that, with the proposed algorithm, we have to process only a fraction of the whole dataset. Notice that, to get the phase maps of Fig. 11, we have corrected a global phase jump between them.

 figure: Fig. 11.

Fig. 11. Wrapped phase obtained after demodulating the fringe pattern whose first and last image are presented in Fig. 9(a)) and b), respectively, using the proposed incremental algorithm. The result of the incremental PCA demodulation algorithm after processing 14 fringe patterns is shown in Fig. 11(a)) and the result of the standard PCA algorithm after processing the whole dataset of $N = 17$ fringe patterns is displayed in Fig. 11(b)). Notice the agreement between both phase maps.

Download Full Size | PDF

In Fig. 12, we show another pair of fringe patterns corresponding also with the first and last of a sequence of $N = 9$ fringe patterns obtained in an interferometry experiment. In this example, the size of the interferograms is $481 \times 641,$ so $M = 308321$ pixels, and there exists an unknown phase step between each interferogram.

 figure: Fig. 12.

Fig. 12. a) First and b) last fringe pattern of a sequence of interferograms. Compared to the fringe patterns depicted in Fig. 9, they present higher contrast and more noise, including a noticeable periodic noise in the lower left part of the images.

Download Full Size | PDF

The results of the demodulation of the fringe pattern sequence depicted in Fig. 12 are shown in Fig. 13. The fringe pattern showed in Fig. 13(a)) has been obtained after processing six fringe patterns, which was the point at which the phase error indicator reaches the threshold value ${\gamma _0} = 10\; \% $. Again, for comparison purposes, we present the result after demodulating the whole sequence of $N = 9$ fringe patterns with the standard PCA algorithm in Fig. 13(b)). A constant phase jump has been removed as we did before.

 figure: Fig. 13.

Fig. 13. Map corresponding to the wrapped phase obtained after demodulating the fringe pattern sequence corresponding to Fig. 12, with a) the proposed incremental PCA after processing six images and b) the standard PCA demodulation algorithm after processing the whole dataset.

Download Full Size | PDF

Finally, in Fig. 14, we show the evolution of the quality parameter. In this case, we can see a similar evolution for both the standard and incremental PCA algorithms again, with a local minimum of the quality parameter for six interferograms processed, suggesting that processing more than six for this set of interferograms fringe patterns could be redundant, as shown in Fig. 13. Both datasets and the code necessary for processing can be downloaded from Code 1, Ref. [27].

 figure: Fig. 14.

Fig. 14. Evolution of the quality parameter for the set of fringe patterns depicted in Fig. 9. Notice the slight increment of the quality parameter after processing four interferograms for both the standard and incremental PCA algorithms.

Download Full Size | PDF

4. Conclusions

We have devised an incremental principal component analysis algorithm for the fringe pattern demodulation problem adapting an existing incremental SDV algorithm. As a result, it is now possible to perform “on-the-fly” processing of fringe patterns without the need for storing a significant number of images in the computer memory. Furthermore, by using an error-phase quality parameter, it is possible to stop the algorithm once the desired accuracy is achieved, improving, in this way, the performance of the PCA algorithm as only the absolute minimum number of images are processed.

Numerical simulations have been performed to check the algorithm for different values of contrast and noise. The algorithm presents good noise rejection capabilities, being able to deal with low contrast and noisy fringe patterns with similar results to the standard PCA algorithm.

Finally, the results obtained for experimental fringe patterns show that the proposed incremental algorithm is feasible and gives similar results to the standard PCA algorithm. For these experimental fringe patterns, the quality parameter can be used to reduce the number of fringe patterns to be processed, incrementing, in this way, the efficiency of the standard PCA phase demodulation algorithm.

Funding

Agencia Estatal de Investigación (PID2019-108850RA-I00).

Disclosures

The authors declare no conflicts of interest.

Data availability

Data underlying the results presented in this paper are available in Ref. [27].

References

1. H. Abdi and L. J. Williams, “Principal component analysis,” WIREs Comp Stat 2(4), 433–459 (2010). [CrossRef]  

2. R. Bro and A. K. Smilde, “Principal component analysis,” Anal. Methods 6(9), 2812–2831 (2014). [CrossRef]  

3. B. Rime, “Capital requirements and bank behavior: Empirical evidence for Switzerland,” J. Bank. Financ. 25(4), 789–805 (2001). [CrossRef]  

4. R. Pang, B. J. Lansdell, and A. L. Fairhall, “Dimensionality reduction in neuroscience,” Curr. Biol. 26(14), R656–R660 (2016). [CrossRef]  

5. J. P. Cunningham and B. M. Yu, “Dimensionality reduction for large-scale neural recordings,” Nat. Neurosci. 17(11), 1500–1509 (2014). [CrossRef]  

6. F. Yao, J. Coquery, and K. A. Lê Cao, “Independent Principal Component Analysis for biologically meaningful dimension reduction of large biological data sets,” BMC Bioinformatics 13(1), 24 (2012). [CrossRef]  

7. A. Alyass, M. Turcotte, and D. Meyre, “From big data analysis to personalized medicine for all: Challenges and opportunities,” BMC Med. Genomics 8(1), 33 (2015). [CrossRef]  

8. K. P. Murphy, Machine Learning: A Probabilistic Perspective (MIT, 2012).

9. M. Turk and A. Pentland, “Eigenfaces for Recognition,” J. Cogn. Neurosci. 3(1), 71–86 (1991). [CrossRef]  

10. J. M. López-Alonso, E. Grumel, N. L. Cap, M. Trivi, H. Rabal, and J. Alda, “Characterization of spatial-temporal patterns in dynamic speckle sequences using principal component analysis,” Opt. Eng. 55(12), 121705 (2016). [CrossRef]  

11. J. M. López-Alonso, J. Alda, and E. Bernabéu, “Principal-component characterization of noise for infrared images,” Appl. Opt. 41(2), 320–331 (2002). [CrossRef]  

12. P. Rodriguez and B. Wohlberg, “A Matlab implementation of a fast incremental principal component pursuit algorithm for Video Background Modeling,” in 2014 IEEE International Conference on Image Processing (ICIP) (IEEE, 2014), pp. 3414–3416.

13. J. Vargas, J. A. Quiroga, and T. Belenguer, “Phase-shifting interferometry based on principal component analysis,” Opt. Lett. 36(8), 1326–1328 (2011). [CrossRef]  

14. J. Vargas, J. A. Quiroga, and T. Belenguer, “Analysis of the principal component algorithm in phase-shifting interferometry,” Opt. Lett. 36(12), 2215–2217 (2011). [CrossRef]  

15. W. Zhang, X. Lu, C. Luo, L. Zhong, and J. Vargas, “Principal component analysis based simultaneous dual-wavelength phase-shifting interferometry,” Opt. Commun. 341, 276–283 (2015). [CrossRef]  

16. Q. Wei, Y. Li, J. Vargas, J. Wang, Q. Gong, Y. Kong, Z. Jiang, L. Xue, C. Liu, F. Liu, and S. Wang, “Principal component analysis-based quantitative differential interference contrast microscopy,” Opt. Lett. 44(1), 45–48 (2019). [CrossRef]  

17. J. Vargas, C. O. S. Sorzano, J. Antonio Quiroga, J. C. Estrada, and J. M. Carazo, “Fringe pattern denoising by image dimensionality reduction,” Opt. Lasers Eng. 51(7), 921–928 (2013). [CrossRef]  

18. J. Vargas and C. O. S. Sorzano, “Quadrature Component Analysis for interferometry,” Opt. Lasers Eng. 51(5), 637–641 (2013). [CrossRef]  

19. J. Vargas, J. M. Carazo, and C. O. S. Sorzano, “Error analysis of the principal component analysis demodulation algorithm,” Appl. Phys. B. 115(3), 355–364 (2014). [CrossRef]  

20. J. Vargas, C. O. S. Sorzano, J. C. Estrada, and J. M. Carazo, “Generalization of the principal component analysis algorithm for interferometry,” Opt. Commun. 286(1), 130–134 (2013). [CrossRef]  

21. M. A. Escobar, J. C. Estrada, and J. Vargas, “Phase-shifting VU factorization for interferometry,” Opt. Lasers Eng. 124, 105797 (2020). [CrossRef]  

22. M. Servin, M. Padilla, G. Garnica, and G. Paez, “Fourier spectra for nonuniform phase-shifting algorithms based on principal component analysis,” Opt. Express 27(18), 25861–25871 (2019). [CrossRef]  

23. J. Vargas, S. Wang, J. A. Gómez-Pedrero, and J. C. Estrada, “Robust weighted principal components analysis demodulation algorithm for phase-shifting interferometry,” Opt. Express 29(11), 16534–16546 (2021). [CrossRef]  

24. A. Levy and M. Lindenbaum, “Efficient sequential Karhunen-Loeve basis extraction,” in Proceedings Eighth IEEE International Conference on Computer Vision. ICCV 2001 (IEEE Comput. Soc, 2001), 2(8), pp. 739

25. V. Lippi and G. Ceccarelli, “Incremental principal component analysis: Exact implementation and continuity corrections,” ICINCO 2019 - Proc. 16th Int. Conf. Informatics Control. Autom. Robot. 1, 473–480 (2019).

26. Y. Chahlaoui, K. A. Gallivan, and P. Van Dooren, “An Incremental Method for Computing Dominant Singular Spaces,” in Computational Information Retrieval53–62 (Society for Industrial & Applied, 2001).

27. J. A. Gomez-Pedrero, J. C. Estrada, J. Alonso, J. A. Quiroga, and J. Vargas, “Code for Incremental PCA algorithm for fringe pattern demodulation,” Github (2022), https://github.com/InforUCM/Incremental_PCA_Software.

28. J. Deng, D. Wu, K. Wang, and J. Vargas, “Precise phase retrieval under harsh conditions by construction new connected interferograms,” Sci. Rep. 6(1), 24416 (2016). [CrossRef]  

Supplementary Material (1)

NameDescription
Code 1       Code files for all figures (includes all necessary data)

Data availability

Data underlying the results presented in this paper are available in Ref. [27].

27. J. A. Gomez-Pedrero, J. C. Estrada, J. Alonso, J. A. Quiroga, and J. Vargas, “Code for Incremental PCA algorithm for fringe pattern demodulation,” Github (2022), https://github.com/InforUCM/Incremental_PCA_Software.

Cited By

Optica participates in Crossref's Cited-By Linking service. Citing articles from Optica Publishing Group journals and other participating publishers are listed here.

Alert me when this article is cited.


Figures (14)

Fig. 1.
Fig. 1. First, a), and last, b), interferogram of the sequence employed to test the proposed incremental PCA algorithm. Both interferograms present low contrast, $m\; = \; 0.15$, and high uniform noise, $SNR\; = \; 5$, with a random phase shift between them.
Fig. 2.
Fig. 2. Results obtained after applying the standard PCA algorithm a) first and b) second principal component, c) demodulated wrapped phase and d) original wrapped phase. Notice that the algorithm has been able to demodulate correctly the phase. Still, the resulting phase map presents noise due to the noisy input fringe patterns, like those shown in Fig. 1.
Fig. 3.
Fig. 3. Phase demodulation with the incremental PCA algorithm after processing a) 5, b) 10, c) 15, and d) 20 fringe patterns of the set. Notice that the demodulated phase after processing the whole set of fringe patterns is similar to the phase depicted in Fig. 2(d)).
Fig. 4.
Fig. 4. a)Phase demodulated with the incremental PCA algorithm after processing 20 fringe patterns. b) Phase demodulated using the robust PCA-based algorithm described in Ref. [28].
Fig. 5.
Fig. 5. Demodulation results of three different sets of fringe patterns using the proposed incremental PCA algorithm. a) The first set formed by low-contrast and noisy fringe patterns, b) the second set formed by average-contrast and average-noise fringe patterns, and c) the third set formed by high-contrast and low noise fringe patterns. Notice that a global phase jump may exist between the recovered wrapped phase maps.
Fig. 6.
Fig. 6. Modulation of the three different sets of fringe patterns demodulated with the proposed incremental PCA algorithm for the three levels of SNR and contrast defined in Fig. 5. Notice that a double-frequency ripple distortion that appears due asynchronous nature of the phase-shifting PCA method
Fig. 7.
Fig. 7. Difference between the wrapped phase demodulated with the proposed incremental PCA algorithm and the exact wrapped phase for the three levels of noise and contrast described in Fig. 5. Notice that a double-frequency ripple distortion that appears due asynchronous nature of the phase-shifting PCA method
Fig. 8.
Fig. 8. Evolution of the phase-error indicator against the number of iterations for three sets of synthetic fringe patterns with the same phase but different contrast and noise. The triangles correspond to low-contrast (c = 0.35), high noise (SNR = 40), the squares to medium-contrast (c = 0.5) average noise (SNR = 80) and the diamonds to high-contrast (c = 0.7), low-noise (SNR = 240) patterns. Notice the decrement of the phase-error indicator value with the increasing number of iterations.
Fig. 9.
Fig. 9. First, a) and last b) fringe pattern of the sequence corresponding to an interferometric experiment. There is a global phase jump between these interferograms, otherwise identical.
Fig. 10.
Fig. 10. Evolution of the quality parameter as a function of the number of images processed for the set of experimental interferograms depicted in Fig. 7. We can see a similar evolution for the incremental PCA (blue squares) and the standard (red triangles) algorithms.
Fig. 11.
Fig. 11. Wrapped phase obtained after demodulating the fringe pattern whose first and last image are presented in Fig. 9(a)) and b), respectively, using the proposed incremental algorithm. The result of the incremental PCA demodulation algorithm after processing 14 fringe patterns is shown in Fig. 11(a)) and the result of the standard PCA algorithm after processing the whole dataset of $N = 17$ fringe patterns is displayed in Fig. 11(b)). Notice the agreement between both phase maps.
Fig. 12.
Fig. 12. a) First and b) last fringe pattern of a sequence of interferograms. Compared to the fringe patterns depicted in Fig. 9, they present higher contrast and more noise, including a noticeable periodic noise in the lower left part of the images.
Fig. 13.
Fig. 13. Map corresponding to the wrapped phase obtained after demodulating the fringe pattern sequence corresponding to Fig. 12, with a) the proposed incremental PCA after processing six images and b) the standard PCA demodulation algorithm after processing the whole dataset.
Fig. 14.
Fig. 14. Evolution of the quality parameter for the set of fringe patterns depicted in Fig. 9. Notice the slight increment of the quality parameter after processing four interferograms for both the standard and incremental PCA algorithms.

Equations (10)

Equations on this page are rendered with MathJax. Learn more.

I k = b + m cos ( Φ + δ k ) ,
X = [ i 1 , i 2 , i 3 , , i N ] ,
X = [ i ~ 1 , i ~ 2 , i ~ 3 , , i ~ N ] ,
X = U S V T
X T X = ( U S V T ) T ( U S V T ) = V S 2 V T .
F = X V U S ,
X ^ = F ^ V ^ T ,
F 1 = m cos ( Φ ) , F 2 = m sin ( Φ ) .
Φ w = arctan ( F 2 F 1 ) ,
γ = ( σ 1 / σ 2 1 10 ) 2 + ( σ 3 σ 1 + σ 2 2 σ 3 ) 2
Select as filters


Select Topics Cancel
© Copyright 2024 | Optica Publishing Group. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.