1. Introduction
Particle Image Velocimetry (PIV) is a tool for analyzing flow fields in an experimental environment [
1]. PIV typically seeds a working fluid with small particles that are illuminated by a plane laser [
2]. A high-speed camera captures an image pair at a set time interval (
t) and the displacement of the particles between the two images divided by
t to produce a velocity field. The method of determining the displacement has developed over the years with advancements in digitization, computing power, and camera technology [
3]. In particular, techniques for estimating the velocity field from the particle images have been developed steadily through the 1990s and 2000s [
4]. However, there has been a paucity of recent developments in this field.
Popular current methods for PIV image analysis include image deformation [
5,
6], window shifting [
7], interpolation schemes for sub-pixel accuracy [
8], and the use of fast-Fourier-transforms [
9]. All of these methods reach beyond the basic cross-correlation methods used in the early days of PIV [
10,
11,
12]. Basic cross-correlation as described by Keane and Adrian [
11] is shown in Equation (1). This method overlays small interrogation windows (
I1,
I2) from the two images and multiplies the pixel intensity values of the pixels (from 0 to some maximum value) in corresponding positions (
x,
y), with the second image shifted by a displacement vector (
u,
v). The displacement vector is varied across the size of the interrogation window so all possible overlap positions are calculated. This results in a field of
C values where the highest value of
C denotes the displacement vector with the best match of the two window’s pixel intensity values.
Image-deformation methods introduce a second step after an initial run of basic cross-correlation across an interrogation window. This is an image-resampling step which determines a new layout of points corresponding to the (
x,
y) positions in the undeformed interrogation window using Equation (2). All terms on the right-hand side come from the data collected from the initial basic cross-correlation.
As the resulting (
xs,
ys) is often sub-integer, an interpolation scheme is needed to determine what the corresponding pixel-intensity value should be based on the original
I2. This sub-pixel interpolation can be performed with different interpolation schemes, for example bilinear [
6], B-spline [
13] or Gaussian peak interpolation [
8]. Sub-pixel interpolation can also be used directly after an initial run of basic cross-correlation. Once the displacement vector is found at an integer whole-pixel level, iterative rounds of sub-pixel shifts in the interrogation window on the second image are performed until the difference to the previous round is close to zero.
Window shifting involves the application of a central difference interrogation algorithm, rather than the forward one employed by conventional PIV analysis techniques. Interrogation windows are shifted
and
from a starting grid of points at time
t, midway between the two image captures [
7]. Given this process involves knowing the displacement of the interrogation window an iterative method must be involved using an initial run of basic cross-correlation.
The basis of these more complex methods still rest on the fundamental step of calculating a cross-correlation field for individual interrogation areas, which can lead to lengthy calculation time that grows with the size of the interrogation window. Some methods, such as the window shifting and sub-pixel interpolation also involve unknown rounds of iteration. This further adds to the calculation load and time. Another issue when using methods involving an interpolation scheme is peak-locking [
14]. Peak-locking error comes from the sub-pixel interpolation schemes being used on originally discrete distributions from the cross-correlation step.
This paper proposes a polynomial approximation method for PIV image reconstruction. By employing a preprocessing blur on the image pairs, the cross-correlation field becomes rounded and the surface can be approximated by a standard quadric equation [
15]. While other image-analysis methods use interpolation schemes to find the sub-pixel location for the best fit displacement, this polynomial method has an analytical solution for the best-fit vector so no interpolation scheme is needed.
2. Materials and Methods
2.1. The Proposed Polynomial Solution Method
The two images
and
from the collected image pair are blurred using a 2-D Gaussian smoothing kernel with a standard deviation of 8 and 0 edge padding to give
and
. This relaxation of the objective surface yields a smooth objective surface that can be relatively well defined by hyperbolic expressions.
Figure 1 shows the standard objective surface often used in estimation of a velocity vector (
) at some point (
) (left) compared to surface generated by the proposed blurring method (right). To ensure consistency with published methods in PIV analysis, both of these surfaces were generated with the cross-correlation equation (Equation (3)) rather than the objective surface equation of the proposed method.
where
is the cross-correlation value for a given vector displacement (
).
I(
x +
m,
y +
n) is the light intensity value for the given pixel at (
x +
m,
y +
n) in the first image. The domain of consideration is centered at
x,
y and ranges across 2
M + 1 by 2
N + 1;
I2 is the intensity at the displaced second image. The candidate values of
u and
v range are evaluated on a domain from −
M to
M and −
N to
N.
The proposed method uses a different approach the (2
M + 1) * (2
N + 1) grid search for each location of interest. A grid of nine points is located around the best
u and
v estimates (
, respectively) on the interrogation window, defined by Equation (4). Initially,
and
were defined as zero, and the half-range of the initial grid (
) is defined as five pixels.
determines the size of the domain of nine candidate vectors that are used to characterize the objective surface across. The refining of
in successive iterations allows the algorithm to converge upon an optimal vector.
The
u and
v values of those nine points are used in Equation (7) nine times to generate the matrices defined in Equation (6). The alpha values in Equation (7) are unknowns, and will define the shape of the polynomial surface generated by Equation (5) that best matches the correlation surface created with Equation (5)
Those alpha values are evaluated with Equation (7) using the inverse operation (in this paper, the MATLAB 2022b inverse operator was used). Once Equation (5) is fully defined, the minima of the surface is found with the first derivatives of the surface, Equation (8). The derivatives in Equation (8) can be set to zero to locate the minima, Equation (8). Solving the two resulting equation , Equation (8) gives the optima u and v locations ().
As the original array of light intensity values is discretized, Equation (7) finds the closest pixel location for the minima point, and the process is repeated from Equation (4) through Equation (7) where , and a final time from Equation (4) through Equation (8) where ).
Equations (3)–(9) are repeated across
= {1, 2, 3} iterations with
, respectively. For the final iteration (
), Equation (9) is ignored. The locations of interest are shown for an arbitrary case in
Figure 2b.
The final
uopt and
vopt values (depicted as the red star in
Figure 2) provide the optimal shift between the two images indicating the velocity vector. The process is repeated for every location of interest to build a velocity vector field. The interrogation areas used in this implementation were 65 × 65 pixels (
M =
N = 32). The velocity field was identified at 12 pixel increments to generate a comprehensive velocity vector field. To avoid issues with incomplete interrogation fields, the first location of interest was located 38 pixels from the edge.
2.2. Validation of Solution on Synthetic Data
The initial validation of this method uses reference velocity vectors created with the in silico PIV-image-generation code developed by Mendes et al. [
16]. The generation code outputs two PIV images based on inputs such as flow type, particle size, particle density, and velocity. The proposed method was tested with the flow type ‘Rotated Shear Flow’ which demonstrates a range of velocity magnitudes, and areas of flow that required sub-pixel accuracy to resolve. The inputs to the image-generation code are as follows: Pixel Radius = 3.0; Particle Density (Ni) = 12; Displacement Ratio (DeltaXFactor) = 0.2; Noise Level = 0; Out-of-plane standard deviation = 0.025. The velocity vectors provide a true solution to compare the results of the proposed method against. To compare the generated vectors to the reference vectors the average error per vector was found for several different particle sizes, maximum speeds and particle density. This average error per vector was taken from the total error summed from every comparison between the magnitudes of the generated and reference vectors as shown in Equation (10). The maximum relative vector error was also compared to the largest vector magnitude present in the reference vectors.
2.3. Validation of Solution on In Vitro Data
This method will also be validated on PIV image data from an experiment considering perioperative bypasses in the supra-aortic branches by Williamson et al. [
17]. This experiment measured the flow in a compliant phantom of the aorta, supra-aortic arteries and their bypasses and pulsatile flow waves. The camera focus was set precisely to ensure the illuminated light sheet was in focus, and therefore there was minimal blur of the particles on the raw images. The raw image is of 1768 × 2352 pixel resolution, which allows for particles to show as an area of multiple pixels. The blur on the edge of each particle is very minimal before the preprocessing blur is applied in the polynomial method. The images used in this paper were from the peak flow of this waveform. This peak flow point was selected, as there would be strong flow signals useful for intuitive interpretation and statistical analysis. The image pair is displayed in
Figure 3, with a time difference of 400 microseconds between the two image captures. Note that light refraction from the laser caused bright spots on the phantom walls.
Equations (1)–(7) were used without alteration across the in silico and in vitro datasets. Reference vectors were not available from the in vitro original experiment; however, they can be calculated using the cross-correlation method outlined above.
2.4. Processing Time Comparison Between Methods
The computer calculation time for a variety of image sizes was evaluated on an 11th Gen Intel® Core™ i7-11700 @ 2.50 GHz with 32 GB installed RAM (HP Inc., Palo Alto, CA, USA) using Matlab 2022b. The time taken to perform the vector analysis for each method was measured using the MATLAB ‘tic-toc’ function. The difference in time between the Basic PIV method and the proposed polynomial method can be calculated and normalized by the image pixel counts that were calculated.
5. Discussion of In Silico Data Results
The in silico results (
Figure 4 and
Figure 5,
Table 1) indicated the proposed method was promising. The velocity vector fields generated by the polynomial approximation method look very similar to the reference velocity fields (
Figure 4c,d). There was a low level of error in the vector field in a variety of flow cases (
Table 1). For context, competitors in the PIV challenge reported errors in the range of 2–6 pixel magnitudes for a similar problem using a Rankine Vortex flow [
18]. The proposed approach was robust to changes in the image generation code as the particle size and density was varied. This demonstrated the method’s potential across a wide range of PIV situations. The maximum error percentage stayed under 20% for every case displayed in
Table 1 and under an average of 0.25 pixel/dt per vector.
This low average error rate shows an improvement over methods that do not determine the sub-pixel cross-correlation peak. Methods that do not optimize to the subpixel scale have a minimum average expected error of 0.383 (based on ). The lowest error for the proposed method occurred in the parabolic test case with small particles, moderate density and lower maximum velocity with an average error per vector of only 0.122 pixels. The accuracy which exceeds the theoretical maximum accuracy is due to the smoothing effects of the approach effectively capturing flow-vector coherence information from not just the optimal vector, but also from vectors close to the optimal vector. Furthermore, the appearance of PIV particles in discrete pixel-space does not necessarily preserve the pixel shape for a particle across image pairs. Hence, the relaxation (or convolution) phase of the proposed approach ultimately leads to a smoother objective surface that is more coherently observed by the optimization process.
The particularly strong performance in the ‘parabolic’ case was somewhat expected, as the parabolic flow type only has horizontal flow that changes magnitude depending on the y value. The solution with the lowest relative error was the ‘stagnation flow’ case with medium particle size, moderate density, and high maximum velocity (however, this had a higher average error per vector than the parabolic flow). Both of these cases had flow in only one orthogonal direction. When the particles are moving uniformly in one direction, the vector has only one component, so the potential for error is reduced. The largest relative error occurred in the Uniform Rankine flow with small particles, high density, and high maximum velocity. This error behavior was expected, as a Rankine vortex has a sharp change in flow velocity at the horizon radius, which physical flow situations cannot experience due to the coherence between fluid layers.
The worst errors were in the velocity transition zones near the Rankine vortex horizon. The in silico simulation of the Rankine vortex had a sharp change in velocity profile, which is not typical in subsonic flows. Thus, any peak within the interrogation window is ultimately smoothed off. However, this error is common to most PIV approaches as velocity is typically assumed constant across the interrogation window. Nonetheless, increased camera resolution and a higher seeding-particle density would allow a smaller interrogation region and thus smaller averaging error.
The proposed method only needs to calculate 27 correlation values to find the optimum displacement position. This is significantly less than the typical (2
M + 1) * (2
N + 1) exhaustive search. The results from
Table 2 with the processing time calculations show this difference in computational burden has a demonstrable effect. Other methods, including those used by OpenPIV and PIVlab, perform an entire field cross-correlation before using a Gaussian-fit method to get the subpixel accuracy. This approach is computationally expensive for large interrogation windows, as the number of entries needing to be calculated in the correlation matrix is a 4:1 ratio of the number of pixels in the interrogation window. The proposed method bypasses the unnecessary calculations from {
u,
v} values, which, after some preliminary calculations, are highly unlikely to contain the optima. By measuring the performance on the course 3 × 3 grid of nine points, then refining the grid size and reevaluating, the proposed approach is similar to a bisection method. This approach is only achievable due to the Gaussian smoothing of the original pictures. This smoothing allows locations proximal to the optima to have a moderate correlation score. This allows convergence to the optimal value. In contrast, when only points in space are illuminated, locations proximal to the optimum will have a low correlation, and an exhaustive search is necessary. When the image size increased, the speed ratio also increased. This indicates that the proposed polynomial method gets faster in comparison to the basic PIV method [
19] when the image size is increased, and is still faster in the smaller images.
The validation process used when evaluating this proposed polynomial approach also has some limitations. Some of the aspects of in vitro data that were not included in this experiment were background noise from the material behind the experiment phantom, difference in contrast between images due to the laser pulse timing, out-of-plane motion or artifacts from either the camera, or flaws in the experiment materials. None of this is captured in the in silico data. Thus, the proposed approach was not validated with respect to these known effects. Nonetheless, this preliminary in silico analysis was undertaken to evaluate the approach with a known true value to compare the optimization against. This direct comparison allowed a direct validation against known values rather than the axiomatic validation of using in vitro data. The images were generated from exact equations, and thus the reference vectors could be found directly from these equations. The majority PIV work is applied to in vitro flows. However, the accuracy of a proposed method is much harder to evaluate statistically when applied to data that lacks a known perfect solution. The behavior of the in vitro flow can be theorized based on the experiment set-up and previous published work on the flow characteristics but there will not be a perfect reference to evaluate against.
6. Discussion of In Vitro Results
The proposed method was proven to be efficient and effective when applied to PIV data that was generated in silico. However, the proposed method yielded unusable, incoherent images when applied to the in vitro PIV images (
Figure 7). The traditional method was successful in the in vitro data (Williamson et al. [
17]) and exhibited coherent image reconstruction using the same data (
Figure 7). A large portion of the vectors in the in silico data are above 15 pixels in magnitude, which is equivalent to 2.25 ms
−1. The known velocity was in the region of 0.1 to 0.5 ms
−1, which is shown in the findings of Williamson et al. [
17]. That velocity equates to a pixel offset of approximately one to four pixels between image pairs, and was well within the accepted recommendation of pixel offsets no more than 1/4th the size of the interrogation window [
20] of 32 pixels by 32 pixels. This pixel offset would have been within the
pixel bounds of the proposed methods. The consistently erratic vector directions and magnitudes indicate an absolute failure in the method. As the haemodynamics this in vitro experiment is mimicking are through cylindrical smooth geometry with simple boundary conditions, the flow vector field is expected to be coherent with no discontinuities. This is because the flow must adhere to the Navier–Stokes equations [
21], and at the Reynolds Number calculated for this in vitro example [
17] the flow is expected to be laminar [
22]. The incoherence of the flow profiles generated by the proposed method imply that statistical analysis is superfluous.
As
Figure 6 shows, the wall imperfections dominate, as they are much brighter than the areas around them, and the zoom in section in (
Figure 6c) displays how much brighter the wall is than the particles in the flow space. After blurring, these particles lose light intensity and noise in the background is amplified. While this issue could be mitigated by masking the wall regions, incoherent vector estimations were observed in regions distant from the walls (
Figure 7 and
Figure 8). These results mean the approach, which was validated in in silico data, was not valid for use in in vitro data.
To attempt to overcome the issues with the application of the method to the real data, a number of preprocessing methods were applied to the in vitro data images. These included applying scaling curves to ensure light-intensity matching across image pairs and transforming the images using sigmoidal functions that amplify particles and mitigate the lightness where there were no pixels apparent, and thresholding. However, none of the preprocessing methods yielded suitable velocity vectors.
While the in vitro results were disappointing and indicate the approach is not currently fit for our purpose, there is excellent performance of the approach in in silico data as well as apparent, and theoretically justifiable, consistent improvement of the theoretical limit of precision. The authors feel this implies that it is suitable for presentation to the academic community. Despite the initial success of the in silico results it was important to consider in vitro testing. PIV is a useful tool for validating computational fluid dynamic models or to capture flow with complex fluid to solid interactions. This is why testing and reporting on the proposed approach with PIV data was important.
Future work to improve this method for use in PIV experimental image processing seems possible if the right prepossessing is determined. However, such an augmentation will alter the in vitro image characteristics to conform to the characteristics of the in silico data and therefore could negate the savings in time and computational load.