## 2 Improvement of DPIV Algorithm
### Improved WIDIM Algorithm
#### 2.2.2 MLS Algorithm  
In the DPIV window deformation algorithm, a deficiency in the boundary node value often exists in the displacement field to be interpolated, which is caused by assigning the obtained displacement value by default to the grid center node. As shown in Figure 5, the absence of the value at the field boundary leads to a number of \"NaN\" values in the interpolation result. The interrogation window is deformed according to the interpolation results. The interpolation results is close to actual displacement distribution so that the deformed interrogation window has good following performance. However, the \"NaN\" values seriously affect the deformation effect of the interrogation window. The key to solve this problem is to assign values to the displacement deficient. The assigned value is obtained by considering all the displacement field information. Therefore, the WIDIM algorithm is improved by the MLS algorithm. The current displacement field is fitted by MLS before each interpolation, and the deficient boundary values are supplemented by surface fitting functions. The MLS algorithm is an enhanced version of the least square method algorithm, and can solve fitting smoothness and localization problems. As shown in Figure 5, the displacement field is expressed as \(D(x_{ij},y_{ij},z_{ij})\) (\(i=1,\ldots,6,j=1,\ldots,6\)). \(x_{ij}\) and \(y_{ij}\) are the coordinate values of node \((i,j)\), and \(z_{ij}\) is the corresponding displacement value. Therefore, the surface fitting process is as follows:  
The surface fitting function [39] of the displacement field in Figure 5 can be expressed as  
\[f(x,y)=\sum_{k}^{l}\alpha_{k}(x,y)\mu_{k}(x,y)=\mathbf{\alpha}(x,y)\mu^{T}(x,y), \tag{9}\]  
where, \(\mu(x,y)\) is basis function and has multiple forms that can be written as  
\[ \begin{array}{ll}\mu(x,y)&=\big{[}\mu_{1}(x,y),\mu_{2}(x,y),\ldots,\mu_{l} (x,y)\big{]}&l=3,\\ &=\left\{\begin{array}{ll}[1,x,y],&l=3,\\ 1,x,y,x^{2},xy,y^{2}\Big{\}},&l=6,\\ 1,x,y,x^{2},xy,y^{2},x^{3},x^{2}y,xy^{2},y^{3}\Big{\}},&l=10.\end{array}\right.\end{array}  \tag{10}\]  
To meet the requirements of both accuracy and computational complexity, the value of \(l\) in this paper is 6. Figure 5: Displacement field with boundary node value deficiency and interpolation results. The local approximation function of Equation (9) in the domain of \((x,y)\) is defined as  
\[f[(x,y),(\overline{x},\overline{y})]=\sum\limits_{k=1}^{l}\alpha_{k}(x,y)\mu_{k} (\overline{x},\overline{y})=\mathbf{\alpha}(x,y)\mathbf{\mu}^{\mathrm{T}}(\overline{x},\overline{y}), \tag{11}\]  
where, \(\alpha_{k}\) (\(x\), \(y\)) is obtained by the weighted least squares fitting of local approximation function \(f[(x,y),(\overline{x},\overline{y})]\). \(\alpha_{k}\) (\(x,y\)) should make \(f[(x,y),(\overline{x},\overline{y})]\) as close to the theory value as possible. For the displacement field in Figure 5, this means minimizing  
\[ \begin{array}{ll}I&=\sum\limits_{i=2}^{5}\sum\limits_{j=2}^{5}\omega\left( \sqrt{\left(x-x_{ij}\right)^{2}+\left(y-y_{ij}\right)^{2}}\right)\left[f\left( \left(x,y\right),\left(x_{ij},y_{ij}\right)\right)-z_{ij}\right]^{2}\\ &=\sum\limits_{i=2}^{5}\sum\limits_{j=2}^{5}\omega\left(\sqrt{\left(x-x_{ij} \right)^{2}+\left(y-y_{ij}\right)^{2}}\right)\left[\sum\limits_{k}^{l}\alpha_ {k}(x,y)\mu_{k}\left(x_{ij},y_{ij}\right)-z_{ij}\right]^{2}\end{array} , \tag{12}\]  
where, \(\omega\left(\sqrt{\left(x-x_{ij}\right)^{2}+\left(y-y_{ij}\right)^{2}}\right)\) is the weight function with the property of a compact support set and (\(x_{ij}\), \(y_{ij}\)) is the coordinate of node \((i,j)\) in the displacement field in addition to the point in the compact support domain.