## 2 Algorithm
### Second Step: Particle Identification and Matching
The spanwise velocity is almost zero, and the maximum distance in spanwise is less than \(3D\), i.e., \(b=3\), as shown in Figure 5. Note that the values of \(a\) and \(b\) can be set to other values, and \(a=1\) and \(b=3\) achieves satisfactory accuracy and efficiency in this paper. Figure 4: (**a**) Moving particle in the original position; (**b**) moving particle in current position; (**c**) binarization after two image subtraction. Red star and blue points represent particle center determined through classic subtraction procedure and the current prediction-confirmation procedure, respectively. The red square and white square is the searching area for re-recognizing the centroid and diagnostic window. Determination of particle position. The peaks of the correlation coefficient \(C_{\text{\tiny{D}}}\), indicate maximum similarity between the two diagnostic windows (Figure 6a). Thus, the displacement can be determined based on the peaks of \(C_{\text{\tiny{D}}}\). When two or more peaks appear (due to similarity among particles or particle deformation), an additional criterion is required for determining the right one. A combination of the commonly used maximum-value method (which considers the shape and color of active particles) and the Kalman filter (which takes shape and motion parameter of active particles into account) is used in the present study. As shown in Figure 6b,c, we calculated the correlation coefficient of one moving particle between two images within the range of yellow square. Figure 6a shows the contour map of correlation coefficient with two peaks due to particle similarity. Due to particle deformation, the position of the maximum peak is not the correct current position. After the Kalman filter, the corrected current position was closer to the true which marked as blue circle in Figure 6.  
The model of particle movement follows approximately a linear dynamic system for which the Kalman filter can be used to predict its behavior. As particles move continually between two successive images, the distance between the current image pair should be related to the previous image pair. The linear Kalman filter estimates the current state at time \(k\) based on the state at \((k-1)\) as follows:  
\[X(k|k-1)\ =\ X(k-1|k-1)+v(k-1)\Delta t+w_{k1} \tag{2}\]  
\[Y(k|k-1)\ =\ Y(k-1|k-1)+u(k-1)\Delta t+\frac{1}{2}\alpha(k-1)\Delta t^{2}+w_{k2} \tag{3}\]  
Figure 5: The diagnostic window (red square) and searching area (yellow square). Figure 6: (**a**) Contour map of correlation coefficients; (**b**) moving particle at the first image; (**c**) moving particle at the second image. The peaks, initial position, and predicted position are represented by red stars, red circle, and blue circle, respectively. Red square and yellow square represents the diagnostic window and searching area, respectively. where \(X(k\mid k-1)\) and \(Y(k\mid k-1)\) are predictions of \(x\) and \(y\)-coordinate at time \(k\), respectively, \(X(k-1|k-1)\) and \(Y(k-1|k-1)\) are optimal results at time \((k-1)\), \(u\) and \(v\) are instantaneous velocity components in \(y\) and \(x\)-axis, respectively, \(\alpha(k-1)\) is acceleration at time \((k-1)\), \(\Delta t\) is time interval, and \(w_{k1}\) and \(w_{k2}\) are process noises which follow Gaussian distribution with zero mean. Based on particle shape and gray level, the maximum peak to the prediction is determined to be the position of the measured value, \(X_{m}(k)\) (Figure 6). Bilinear interpolation is then applied to achieve subpixel precision [30]. Note that \(X(k\mid k-1)\) is determined by particle velocity, acceleration and position in the previous frame, the change in velocity and acceleration will inevitably induce errors. There is an error between \(X_{m}(k)\) and real position because of the similarity between target and background particles. It is recommended that the optimal Kalman gain \(Kg(k)\) is applied to contain errors.