## 2 Materials and Methods
### Frequency-Guided Sequential Demodulation  
The FSD demodulation method was developed by [PERSON] and [PERSON], as explained in the introductory section, to demodulate closed fringe patterns with a single interferogram. The sequential algorithm FSD is explained below in the following 6 steps (for a more detailed explanation the reader is encouraged to consult references [16; 28]):  
1. The pre-processing image (denoise filtering), which consists of attenuating possible noise \(\eta(x,y)\) of the interferogram \(I_{\eta}(x,y)\), taking care that the interference fringes are not distorted. With this process, \(\eta(x,y)\) is suppressed from \(a_{n}(x,y)\) to obtain the filtered background intensity \(a(x,y)\) of the filtered interferogram \(I(x,y)\), which is \[I(x,y)=a(x,y)+b(x,y)\text{cos}(\varphi(x,y)).\] (2)
2. To cancel the background intensity \(a(x,y)\) and the modulation amplitude \(b(x,y)\) coefficients, a normalization procedure has to be carried out considering that both terms vary slowly compared to the cosine of the phase. Usually, high-pass filters can be used to remove background intensity, but there are regions of \(b(x,y)\text{cos}(\varphi(x,\ y))=f(x,y)\) that can also present low frequencies, especially when the phase is flat, so information can be lost with this type of filtering. Another more efficient way to eliminate the coefficient \(a\) is using the Empirical Mode Decomposition (EMD), which decomposes the signal in many harmonics and a residual noise term, as shown in [29]. It continues with the elimination of the modulation coefficient \(b(x,y)\); for this, it is suggested to use the Hilbert transform to obtain \[H\{f(x,y)\}=-b(x,y)\text{sin}(\varphi(x,\ y)),\] (3) and with which the term \(b(x,y)\) can be eliminated in two ways: the first one obtaining the magnitude to find \(b(x,y)\), which is \[b(x,y)=\sqrt{(H\{f(x,y)\})^{2}+(f(x,y))^{2}},\] (4) and then divide by \(f(x,y)\); and the second one is applying a cosine function to the \(\arctan(-H\{f(x,y)\}/f(x,y))\) term. Therefore, the normalized interferogram becomes \[I_{n}(x,y)=\text{cos}(\varphi(x,y)).\] (5)
3. The direct extraction of the phase \(\phi_{wa}(x,y)\), which is carried out by applying the arccosine function to the interferogram. This stage of the phase is used to calculate the intermediate frequencies \(\hat{\omega}_{xa}(u,v)\) and \(\hat{\omega}_{ya}(u,v)\), where \((u,v)\) are the local coordinates of the window being processed. Once the optimization process is complete, the final frequencies \(\hat{\omega}_{a}(u,v)\) are available, which guarantees that the optimization algorithm found a global minimum. Then, \[\hat{\varphi}_{wa}(x,y)=\arccos(I_{n}(x,y)),\ \ \in[0,\pi].\] (6)
4. The extraction of the local phase \(\widetilde{\hat{\varphi}}_{a}(x,y)\) is considered linear in a small window of the interferogram. The energy function is defined as the square of the difference of the normalized interferogram \(I_{n}(x,y)\) and the virtual interferogram \(\widetilde{I}(x,y)\) is calculated. Then, the local frequencies are allocated inside the minimized energy function as \[\hat{P}(u,v)=\big{[}\hat{\omega}_{xa}(u,v),\hat{\omega}_{ya}(u,v)\big{]}^{T}.\] (7)
5. The extraction of the estimated frequency by the optimization method, which is a vector of two calculated values of the pixel under study. 6. Eliminate the ambiguity error. Finding a function for the determination of the sign \(s\), which depends on the final frequencies and the local phase. To optimize the FSD algorithm, both evolutionary algorithms, the PSO (proposed optimizer) as well as the HSO (optimizer used in [1]), were applied. The proposed method is summarized in the flowchart shown in Figure 1, where the user can choose among FSD (in black), FSD-HSO or FSD-PSO (both in red). The input parameters to the optimization block are the normalized interferogram \(I_{n}(x,y)\), as well as the local phase \(\hat{\varphi}_{wa}(x,y)\), which are obtained from the first steps of the FSD.