× Home About Account PIV Forums Suggest An Edit Feedback

Learn Particle Image Velocimetry

Menu ☰

How PIV Works

Cross Correlation Computations

To identify the statistically “most likely” movement of particles between the interrogation regions, a cross correlation formula is used. Direct cross correlation is the most straightforward method, albeit slow computationally. Equation 1 provides how to calculate the discrete direct cross correlation.

Here $A_1$ is the matrix of numerical greyscale pixel values for the first interrogation region, $A_2$ is the matrix of numerical greyscale pixel values for the second interrogation region, $D$ is the length of $A_1$, $i$ and $j$ are the row and column indices respectively, and $r$ and $s$ describe the translation of the interrogation region in the $y$ and $x$ directions. The correlation matrix $R$ contains values for a given $r$ and $s$. $R$ matrix values are the sum of the elementwise products of the numerical pixel values for the first interrogation region and the numerical pixel values for the second interrogation region when shifted by $r$ and $s$. By building the $R$ matrix in this manner, the values of $r$ and $s$ that maximize $R$ describe the most likely translation of the interrogation region. The movement of the flow (i.e., magnitude and direction), then, is indicated by the displacement vector drawn from the center of the image to the pixel location of the peak value in the $R$ matrix. The values $r$ and $s$ are typically held within $\pm D/2$ to increase the likelihood of valid correlations and to decrease computational time.

An example of a direct cross correlation computation is shown in Figure 1. Each pixel is either a one (striped) or zero (white). (While PIV uses a wider range of greyscale values coming from the digital images, binary values are used here for illustration purposes only.)

Figure 1. Example interrogation regions for cross correlation [1]. The first image at $t$ shows an area ($A_1$) that will be used to find a correlation in the area $A_2$ in image $t + \Delta t$.

Figure 2 shows how the $R$ matrix is built by overlapping the $A_1$ (red) over a region of $A_2$ (green, region is decided by the range of $r$ and $s$), multiplying the overlapping values, and adding each product. The sum of these products is the $R$ value at that specific $r$ and $s$.

Figure 2. Visual demonstration of cross correlation $R$ matrix development [1]. The $R$ matrix (left) is the sum of overlapping pixels per $r$ and $s$.

Top $(r = -2, s = -2)$: one pair of pixels have an overlapping particle,

Middle $(r = 0, s = 0)$: two pixels pairs have overlapping particles,

Bottom $(r = -2, s = -2)$: five pixel pairs have overlapping particles.

As shown in Figure 2, the pixels which overlap are shaded horizontally and vertically, indicating a product of one in the summation (due to the lack of greyscale values beyond zero and one). The most likely movement of the particles is down two pixels, or $R_{max} = R(r = 2, s = -2) = 5$.

References:
[1] B. L. Smith and D. R. Neal, “Particle Image Velocimetry,” Part. Image Velocim., p. 27, 2016.

Author: Jack Elliott

Date Published: June, 2022