1 Introduction

Electronic speckle pattern interferometry (ESPI) technique is an efficient tool for non-contact, nondestructive measurement of optical coarse surface. With the advantages of high precision, high sensitivity, whole-field and real-time testing, it is widely used in object deformation measurement such as vibration, displacement and strain and nondestructive testing [1, 2]. However, ESPI fringe patterns contain strong inherent speckle noise which creates a grainy appearance and lead to heavy restrain to the fringe on visibility and resolving ability. Meantime, the accuracy of the extracted phase values which is related to the physical quantity to be measured will be affected, leading to a mistaken interpretation or an incorrect measurement. Therefore, it has important significance to research on effective filtering methods for ESPI fringe patterns.

In the past few decades, many filtering methods have been developed for the removal of speckle noise in optical fringe patterns. These methods can be mainly divided into two categories. One is frequency filtering, such as Fourier transform (FT) method [3], windowed Fourier transform (WFT) method [4], localized Fourier transform (LFT) method [5], and wavelet transform (WF) method [6,7,8,9]. The other one is spatial filtering, such as least-square (LS) method [10], adaptive weighted(AW) filter [11], second-order non-oriented PDE (SONOPDE) model [12], fourth-order non-oriented PDE (FONOPDE) models [13], coupled non oriented PDE (CNOPDE) model [14], oriented PDE models, discrete topological (DT) method [15], multivariate empirical mode decomposition (MEMD) method [16], and variational image decomposition (VID) method [17]. Meanwhile, some joint filtering methods have been advanced for the speckle removal of ESPI fringe patterns, such as the combination of median filtering and Symlet wavelet filtering (SWF) method which is proposed in Ref. [18] and the combination of improved Spin filtering (ISF) and wave atoms thresholding method which is proposed in Ref. [19]. Moreover, some efforts have also been devoted to some overview or comparative analysis for the speckle reduction of ESPI fringe patterns, and we refer to Ref. [20, 21] for more details.

The difficulties of simultaneously de-speckling and preserving all fringes perfectly are well-known. The strategy of combining the orientation with the filtering algorithms has attracted increasing attention from researchers. In this strategy, filtering is performed only along fringe orientation. Over the years, different oriented filtering methods have been proposed and demonstrated to be effective in preserving the edges of optical fringe patterns, especially those with high density, while de-speckling.

The existing oriented filtering methods which are developed for ESPI fringe patterns mainly includes: the Spin filtering (SF) [22], the improved Spin filtering (ISF) [23] ,the tangent least-squares fitting filtering (TLSFF) method [24], the oriented spatial filtering mask (OSFM) method [25], the oriented regularized quadratic cost function (ORQCF) method [26], the second-order oriented PDE (SOOPDE) model [27], the second-order double oriented PDE model (named coherence enhancing diffusion method, CED) [28], the coupled non-linear oriented PDE (CNLOPDE) model [29] and so on. In the Spin filtering and the tangent least-squares fitting filtering methods, it is needed to establish a small filtering window along the fringe orientation, and then a speckle reduction method is applied to the established filtering window. Furthermore, the established small filtering window needs to be removed along the local fringe orientations pixel by pixel [22, 24]. In the oriented spatial filter mask method, de-speckling along fringe orientation is carried out by implementing with one pass of oriented spatial filter masks, in which the elements include the orientation of fringe [25]. In the oriented regularized quadratic cost function method and the oriented PDEs-based methods, it is unnecessary to laboriously establish the small filtering window along the fringe orientation, and remove the small filtering window pixel by pixel. In the oriented regularized quadratic cost function method, the de-speckling of the entire fringe pattern along the fringe orientation is realized by minimizing the cost function [27]. In oriented PDEs-based methods, the de-speckling along fringe orientation for the entire fringe pattern is realized by solving the oriented PDEs numerically [27,28,29]. As noted, in all of these oriented speckle reduction methods, the angles of fringe orientation of each pixel have to be calculated in advance.

As demonstrated in Ref. [30], bilateral filtering (BF) is an effective edge-preserving filter. In bilateral filtering method, the weight of each pixel is calculated using a Gaussian function in the spatial domain multiplied by an influence function in the intensity domain which decreases the weight of pixels with large intensity differences. This makes it can preserve the edges and textures of image better than the traditional linear filtering methods. In addition, it can provide high smoothing efficiency without performing the iterative process. Because of the simplicity and easy implementation, the bilateral filter has been widely used in image processing and analysis [31].

In the past, the bilateral filter has been actively extended to a number of enhanced algorithms or to reduce computational complexity. Here, we review a few existing enhanced and accelerated algorithms. For more extension we refer to Refs. [32,33,34,35]. In Ref. [36], the standard bilateral filtering method is extended by building a local adaptive noise reduction kernel. The modified bilateral filtering method can be easily implemented on a parallel machine. In Ref. [37], a bilateral filter which is specialized in the box spatial kernel is designed. It can be convolved fast by histogram technique. In Ref. [38], the method of secondary iterative filtering is proposed. In this method, the results of the first bilateral filtering are used to guide the second bilateral filtering. In Ref. [39], the double bilateral filter with a new median-metric weighting function is proposed. The new median-metric weighting function is designed by incorporating a median filter into a second bilateral filter. In Ref. [40], an accelerating bilateral filtering is proposed using a piecewise-linear approximation in the intensity domain and appropriate sub sampling. In Ref. [41], fast O(1) bilateral filtering is constructed based on trigonometric range kernels. In Ref. [42], a fast implementation of the bilateral filter with arbitrary range and domain kernels is presented. It is a histogram-based fast bilateral filter approximation which uses uniform box as the domain kernel. After that, the approximating arbitrary spatial kernel using a fixed number of boxes is proposed in Ref. [43]. It is found that the multiple-box spatial kernel can be applied in many O(1) acceleration approaches in addition to the histogram-based one.

Now, we outline the main contributions of this paper. In this paper, we propose the oriented bilateral filtering (OBF) with the special application for speckle noise reduction of ESPI fringe patterns based on the direction mask. The proposed method can remove the speckle noise effectively along the fringe orientation. We test the proposed method on four computer-simulated ESPI fringe patterns and one experimentally obtained ESPI fringe pattern, respectively, and compare our method with the previous bilateral filtering method and the tangent least-squares fitting filtering method. In all cases, the oriented bilateral filter is shown to perform better than the other two methods in the de-speckling and edge-preserving.

In the following sections of this paper, we will first review the previous bilateral filtering method briefly which relate to our work, and then describe in detail the oriented bilateral filtering. Section 3 contains experiments and discussion. Section 4 provides a summary of this paper.

2 The oriented bilateral filtering for ESPI fringe patterns

2.1 A brief review of the bilateral filtering method

The bilateral filtering method is proposed by Tomasi and Manduchi as an alternative to anisotropic diffusion [30]. It is a non-linear filter. In this method, the output is a weighted average of input. For each pixel \(q\), its weighting is determined not only by the spatial distance from the center pixel \(p\) but also by the relative intensity difference from the center pixel \(p\). Let \(I_{p}\) be the intensity at pixel \(p\), and \({\text{BF}}\left[ I \right]_{p}\) be the filtered result which is expressed as

$${\text{BF}}\left[ I \right]_{p} = \frac{1}{{W_{p} }}\sum\limits_{q \in S} {G_{{\sigma_{\text{d}} }} \left( {\left\| {p - q} \right\|} \right)G_{{\sigma_{\text{r}} }} \left( {I_{p} - I_{q} } \right)I_{q} } ,$$
(1)

where \(W_{p}\) is a standard quantity.

$$W_{p} = \sum\limits_{q \in S} {G_{{\sigma_{\text{d}} }} \left( {\left\| {p - q} \right\|} \right)G_{{\sigma_{\text{r}} }} \left( {I_{p} - I_{q} } \right)} .$$
(2)

It is applied as two Gaussian filters at the localized pixel neighborhood. One is \(G_{{\sigma_{\text{d}} }}\) which is named the domain filter. It is used to reduce the impact of long-range pixels in the spatial domain. The other one is \(G_{{\sigma_{\text{r}} }}\) which is named the range filter. It is used to reduce the impact of the gray value of pixel \(q\) which is different from the \(I_{p}\) in the intensity domain. These two filters are usually defined as

$$G_{{\sigma_{\text{d}} }} = {\text{e}}^{{\frac{{ - \left\| {p - q} \right\|^{2} }}{{2\sigma_{d}^{2} }}}} ,$$
(3)
$$G_{{\sigma_{\text{r}} }} = {\text{e}}^{{\frac{{ - \left\| {I_{p} - I_{q} } \right\|^{2} }}{{2\sigma_{r}^{2} }}}} ,$$
(4)

where \(p - q\) and \(I_{p} - I_{q}\) are, respectively, the Euclidean distance and the Gray difference for two pixels in the image. \(\sigma_{\text{d}}\) and \(\sigma_{\text{r}}\) are standard deviation based on the Gaussian function. The performance of bilateral filter is determined by these parameters.

In Ref. [39], an improved double bilateral filter is proposed by introducing a new range filter to the classical bilateral filtering. The weighting function is modified by incorporating a median filter. The modified weighting function is expressed as

$$G_{{\sigma_{\text{M}} }} = {\text{e}}^{{\frac{{ - \left\| {I_{p}^{\text{M}} - I_{q}^{\text{M}} } \right\|^{2} }}{{2\sigma_{M}^{2} }}}} ,$$
(5)

where \(I_{p}^{\text{M}}\) represents the median intensity in a \(\left( {2D + 1} \right) \times \left( {2D + 1} \right)\) neighborhood of the corresponding position \(p\).

The double bilateral filter is proposed to improve the performance in the reduction of Gaussian noise. However, it also is competitive in reducing the impulse noise. In Ref. [40], it has been demonstrated that the double bilateral filter is quite adapted to restore the images which are corrupted by the combination of Gaussian and impulse noise.

2.2 The oriented bilateral filtering method

Although, the bilateral filter is a widely used edge-preserving filtering method, it cannot give satisfactory results when it is applied to ESPI fringe patterns. The directivity of ESPI fringe patterns is an important characteristic, and it plays an important role in directing the de-speckling process. It is obvious that denoising along the fringe orientation can effectively remove the noise without disturbing the content of fringes. Based on this point, we design a mean mask along the fringe orientation, as shown in Fig. 1 (named the directional mask). Furthermore, we propose a new bilateral filtering model combined with the directional mask and apply the new method to optical interferometry fringe patterns.

Fig. 1
figure 1

The directional mask of 3 × 7

The directional mask is established as follows:

The size of the mask is \(\left( {2\omega {}_{1} + 1} \right) \times \left( {2\omega {}_{2} + 1} \right)\), which can be changed to obtain satisfactory filtering results. As an example, we set \(\omega {}_{1} = 1\) and \(\omega {}_{2} = 3\), the mask of \(3 \times 7\) is illustrated in Fig. 1. In further, we apply this mask to the fringe patterns with regard to the fringe orientation.

To apply the directional mask properly, as Eqs. (6) and (7) suggest the fringe pattern (i.e., proportional to the directional mask size) needs to be rotated. The rotated coordinate values of the pixel \(I\left( {i,j} \right)\) are, respectively, expressed as:

$$j^{\prime } = j + (u \cdot \cos \theta + v \cdot \sin \theta ).$$
(6)
$$i^{\prime } = i + (u \cdot \sin \theta + v \cdot \cos \theta ).$$
(7)

where u = −3, −2, … 2, 3; v = −1, 0, 1. The angle θ of each pixel’s orientation should be calculated in advance. The rotated pixel of the mask X(i, j) is calculated by (8).

$$X(i,j) = \frac{1}{k}\sum\limits_{u = - 3}^{3} {} \sum\limits_{v = - 1}^{1} {w(u,v)I\left({i^{\prime},j^{\prime}} \right).}$$
(8)
$$k = \sum\limits_{u = - 3}^{3} {} \sum\limits_{v = - 1}^{1} {W(u,v).}$$
(9)

We propose the oriented bilateral filtering method by incorporating the directional mask to the original bilateral filtering method. The proposed method can be expressed as

$${\text{BF}}[I]_{p} = \frac{1}{{W_{p} }}\sum\limits_{q \in s} {G_{{\sigma_{\text{d}} }} \left( {\parallel p - q\parallel } \right)G_{{\sigma_{\text{d}} }} \left( {X_{p} - I_{q} } \right)I_{q} } ,$$
(10)

where the gray value \(I_{p}\) of pixel \(p\) in (2) is replaced by \(X_{p}\).

3 Experiments and discussion

In this section, we select four simulated ESPI fringe patterns and one experimentally obtained ESPI fringe pattern as the tested images to demonstrate the real performance of the oriented bilateral filter, and compare it with the original bilateral filter and the tangent least-squares fitting filter. We extract the skeletons of the filtering results using dot binarization algorithm [44] and Hilditch algorithm [45]. All the computations are completed by MATLAB R2016a under the same conditions of a personal DELL computer equipped with Intel (R) Xeon (R) CPU E5-1650 v3 at 3.5 GHz and 16.0 GB RAM memory. The parameters used in the three methods are listed in Table 1.

Table 1 The parameters for Figs. 3 and 6

As described above, the oriented bilateral filtering method is proposed specifically for fringe patterns which have obvious directivity. The angle \(\theta\) of fringe orientation of each pixel should be calculated before it is implemented. The quality of all tested images is very poor since the levels of noise are high in all test images and the densities of the fringes in the simulated fringe patterns are variable. According to Ref. [46], the Fourier transform method is proposed for estimating the orientation field of optical fringes which are with poor quality. Therefore, we select Fourier transform method to calculate the angle \(\theta\) of fringe orientation of each pixel. We refer to the Ref. [46] for more details of the Fourier transform method. A brief description of this method is shown as follows.

Consider a window with the center point \((x,y)\). Let \((k,l)\) denotes the pixel position in the window. The angle \(\theta (x,y)\) of orientation in this point can be calculated by

$$\theta (x,y) = \frac{1}{2}\tan^{ - 1} \left( {\frac{{\sum\limits_{k} {\sum\limits_{l} {E(\omega_{k} ,\omega_{l} )\sin (2\theta_{k,l} )} } }}{{\sum\limits_{k} {\sum\limits_{l} {E(\omega_{k} ,\omega_{l} )\cos (2\theta_{k,l} )} } }}} \right),$$
(11)

where \(E(\omega_{k} ,\omega_{l} )\) is the power spectrum in the window. \(\theta_{k,l}\) is defined by \(\theta_{k,l} = \text{tan}^{ - 1} (k,l)\) in advance. Moreover, the estimated orientation field should be smoothed by the Gaussian low pass filter.

The four computer-simulated ESPI fringe patterns with the size of \(330 \times 330\) pixels are shown in Fig. 2. The images of Fig. 2a–d are generated with the following equations, i.e.,

$$I_{\text{sub}} = \left| {4\sqrt {I_{o} I_{r} } \sin \left( {\varphi_{r} - \varphi_{o} + \frac{\psi }{2}} \right)\sin \left( {\frac{\psi }{2}} \right)} \right|,$$
(12)

where \(\varphi_{r} - \varphi_{o}\), \(I_{o}\) and \(I_{r}\) taken as random variables with values uniformly distributed over the intervals \([ - \pi ,\;\pi ]\), \([0,\;I_{m} ]\), and \([0,\;\rho I_{m} ]\), respectively, where \(I_{m}\) is a constant value and \(\rho\) is a normalized visibility parameter. In our computer-simulated images, we set \(I_{m} = 8 0\),\(\rho = 0.3\), the phases \(\psi_{i,j}\) corresponding to Fig. 2a–d are calculated with the following equations, respectively:

$$\psi_{i,j} = 40 \times \exp \left( { - \frac{{\left( {i - 0.35 \times m} \right)^{2} + \left( {j - 0.35 \times n} \right)^{2} }}{25000}} \right) - 40 \times \exp \left( { - \frac{{\left( {i - 0.75 \times m} \right)^{2} + \left( {j - 0.75 \times n} \right)^{2} }}{23000}} \right),$$
(13)
$$\psi_{i,j} = 50 \times \exp \left( { - \frac{{i^{2} }}{90000} - \frac{{3(j - {m \mathord{\left/ {\vphantom {m 2}} \right. \kern-0pt} 2})^{2} }}{200000}} \right) + 100 \times \exp \left( { - \frac{{\left( {i - n} \right)^{2} }}{90000} - \frac{{3(j - {m \mathord{\left/ {\vphantom {m 2}} \right. \kern-0pt} 2})^{2} }}{200000}} \right),$$
(14)
$$\begin{aligned} \psi_{i,j} & = 80 \times \exp \left( { - \frac{{\left( {i - 0.5 \times m} \right)^{2} }}{15000} - \frac{{(j - 0.2 \times m)^{2} }}{7000}} \right) + 50 \times \exp \left( { - \frac{{\left( {i - 0.3 \times m} \right)^{2} }}{25000} - \frac{{(j - 0.7 \times n)^{2} }}{18000}} \right) \\ & \quad + 50 \times \exp \left( { - \frac{{\left( {i - 0.98 \times m} \right)^{2} + (j - 0.7 \times n)^{2} }}{18000}} \right), \\ \end{aligned}$$
(15)
$$\begin{aligned} \psi_{i,j} &= 50 \times \left[ {\exp \left( { - \frac{{\left( {2i - m} \right)^{2} + \left( {2j - 3n/2} \right)^{2} }}{90000}} \right) + \exp \left( { - \frac{{\left( {2i - m} \right)^{2} + \left( {2j - 3n/2} \right)^{2} }}{50000}} \right)} \right] \\ & \quad +\,10 \times \left( {\left( {\frac{{3 \times \left( {i - m/2} \right)}}{m}} \right)^{2} + \left( {\frac{{3 \times \left( {j - n/3} \right)}}{n}} \right)^{2} } \right), \\ \end{aligned}$$
(16)

where \(m\) and \(n\) are the image sizes.

Fig. 2
figure 2

Computer-simulated ESPI fringe patterns

The experimentally obtained ESPI fringe pattern with image size of \(330 \times 250\) pixels is shown in Fig. 6a. It depicts the derivative of the out-of-plane displacement of a circular plate. The plate is rigidly clamped at its boundary and is subjected to a central load. The experimental setup for Fig. 6a is shown in Fig. 5. The beam from the laser is first reflected by the mirror then expanded by the beam expander. The expanded beam is split into object and reference beams by the beam splitter. Subsequently, the speckle interferogram is formed by combining the object and reference beams. Finally, the interferogram is detected by the lens and recorded by the CCD sensor. Two speckle interferograms, respectively, achieved in two different states of the object are recorded, and the ESPI fringe patterns can be obtained by subtracting the two interferograms.

Firstly, we apply these three methods to the computer-simulated ESPI fringe patterns which are shown in Fig. 2. The corresponding filtering results are shown in Fig. 3. From Fig. 3a-1, b-1, c-1, d-1, one can find that the original bilateral filter cannot remove the noise effectively and tend to blur the edges of high-density fringes. From Fig. 3a-2, b-2, c-2, d-2, a-3, b-3, c-3, d-3, one can find that the tangent least-squares fitting filter can give better filtering results than bilateral filter, but worse than oriented bilateral filter. The filtering results of oriented bilateral filter are smooth enough and the edges of fringes are preserved well. In addition, we extract the skeletons of the filtering results in Fig. 3. The skeleton images are shown in Fig. 4. As shown in Fig. 4, all the skeletons obtained from the filtering results of original bilateral filter are broken. The tangent least-squares fitting filter can give the skeletons as well as the oriented bilateral filter from Fig. 3a-2, b-2, but it cannot give the satisfying skeletons from Fig. 3c-2, d-2 which contain high-density fringes.

Fig. 3
figure 3

Filtered results of Fig. 2 by the three filters. a-1, b-1, c-1 and d-1 the filtered images by BF method; a-2, b-2, c-2 and d-2: the filtered images by TLSFF method; a-3, b-3, c-3 and d-3 the filtered images by OBF method

Fig. 4
figure 4

Skeletons of filtered results. a-1, b-1, c-1 and d-1 skeletons of black fringes of Fig. 3(a-1), (b-1), (c-1) and (d-1); (a-2), (b-2), (c-2) and (d-1): skeletons of black fringes of Fig. 3(a-2), (b-2), (c-2) and (d-2); (a-3), (b-3), (c-3) and (d-3): skeletons of black fringes of Fig. 3(a-3), (b-3), (c-3) and (d-3)

Secondly, we apply these three methods to the real ESPI fringe pattern which are obtained using the setup in Fig. 5. The filtering results and corresponding skeleton images are shown in Fig. 6b-1–d-2. From Fig. 6b-1, c-1, d-1, we can see that oriented bilateral filter outperforms the other methods both in speckle reduction and fringe edge preservation. Moreover, as shown in Fig. 6b-2, c-2, d-2 only the skeletons extracted from the filtering result of oriented bilateral filter are satisfying. The skeletons extracted from the filtering result of original bilateral filter contain many branches. The skeletons extracted from the filtering result of tangent least-squares fitting filter are broken and have branches.

Fig. 5
figure 5

Experimental setup for Fig. 6a

Fig. 6
figure 6

An experimentally obtained fringe patterns, its filtered images and its skeletons. a Initial image; b-1 The filtered image by BF method; b-2 The skeletons of black fringes of b-1; c-1 The filtered image by TLSFF method; c-2 The skeletons of black fringes of c-1; d-1 The filtered image by OBF method; d-2 The skeletons of black fringes of d-1

Furthermore, to quantitatively evaluate the performance of the oriented bilateral filter, we calculate the mean square error (MSE) for the filtering results of the computer-simulated images which have exact values. The mean square error (MSE) is defined as

$${\text{MSE}} = \frac{1}{M \times N}\frac{{\sum\limits_{i = 1}^{M} {\sum\limits_{j = 1}^{N} {\left[ {u\left( {i,j} \right) - I\left( {i,j} \right)} \right]^{2} } } }}{{\sum\limits_{i = 1}^{M} {\sum\limits_{j = 1}^{N} {\left[ {I\left( {i,j} \right)} \right]^{2} } } }}$$
(14)

where \(M\) and \(N\) are the sizes of test image. \(I\) and \(u\) are the noiseless image and the restored image, respectively. The MSE values of the images in Fig. 3 are shown in Table 2. As illustrated in Table 2, the values of MSE for the images filtered by our oriented bilateral filter are smaller than those by the bilateral filter and the tangent least-squares fitting filter. The quantitative evaluation results are consistent with the visual quality of the filtering results.

Table 2 The MSE values and computational time

Subsequently, we compare the computational time of the oriented bilateral filter with that of the original bilateral filter and the tangent least-squares fitting filter. Table 2 lists the computational time of these three methods for each filtered image in Figs. 3 and 6. As illustrated in Table 2, the tangent least-squares fitting filter requires more computational time than our oriented bilateral filter. The time taken by the tangent least-squares fitting filter with ten iterations is at least 25.19 times our oriented bilateral filter.

From the experimental results, we can draw the following conclusions:

  • The original bilateral filter cannot remove the noise effectively and tend to blur the edges of high-density fringes. Moreover, the skeletons obtained from the filtering results of original bilateral filter are broken especially in high-density regions.

  • The tangent least-squares fitting filter can give better filtering results than bilateral filter, but worse than oriented bilateral filter. In further, the tangent least-squares fitting filter can give the skeletons as well as the oriented bilateral filter from Fig. 3a-2, b-2, but it cannot give the satisfying skeletons from both the simulated fringe patterns which contain high-density fringes and the experimentally obtained fringe patterns.

  • The oriented bilateral filter can give desired filtering results both in simulated fringe patterns and experimentally obtained fringe patterns, and it takes far less computational time than tangent least-squares fitting filter requires.

4 Conclusion

In this paper, we have proposed an oriented bilateral filtering model based on a directional mask and applied the new method to four simulated and one experimentally obtained optical interferometry fringe patterns. The results of experiments have demonstrated that the oriented bilateral filter has a remarkable performance in de-speckling and edge-preserving as compared with the previous bilateral filtering model and the tangent least-squares fitting filter. With our proposed method, all fringes are perfectly preserved, and the speckle noise is effectively removed.