1 Introduction

With the development of technology, fluid flow measurement techniques have gradually replaced flow visualization techniques in the study of fluid dynamics. Extracting the velocity field through measurement techniques allows researchers to analyse complex flow field structures more deeply (Adrian and Westerweel 2011). As a non-contact measurement method, particle image velocimetry (PIV) has become one of the main technical methods for fluid flow measurement. Tracer particles are seeded into the fluid flow to follow its movement, and a sheet of pulsed laser light is employed to illuminate these tracer particles undergoing short displacements with a preset interval time. Meanwhile, a camera is utilized to synchronously capture two image frames of the tracer particles. Finally, the velocity field is calculated by determining the displacements of the particle fields between the two image frames and using the preset interval time (Raffel et al. 2018). Because it allows the velocity field to be determined over an entire image domain, PIV is widely used in many applications, such as aerospace, biological medicine, and nanofabrication. Although PIV has achieved very impressive performance, the measurement accuracy of PIV is significantly influenced by optical imaging technology and PIV measurement methods. Therefore, improving the accuracy and dynamic range of the estimated velocity field remains an important task in the PIV measurement method (Westerweel et al. 2013).

Over the past few decades, various PIV measurement methods have been proposed and developed to improve the measurement accuracy of the velocity field. These methods can be classified into two main groups: cross-correlation-based methods and optical flow-based methods (Heitz et al. 2008, 2010). The traditional cross-correlation-based method divides the particle image into many fixed-size interrogation windows and assumes that all pixels in an interrogation window have the same velocity vector. When calculating the correlation coefficient of two interrogation windows across two successive image frames, one velocity vector that gives the correlation peak is produced for each interrogation window. The cross-correlation method is widely used in various fields because of its reliability, accuracy, and robustness, but the resolution of the estimated velocity field is restricted by the size of the interrogation window (Kähler et al. 2012). The spatial resolution limitations of the cross-correlation-based method are a well-recognized issue, and there have been many efforts to improve the spatial resolution of the velocity field, such as velocity field interpolation and image deformation (Astarita 2008, 2009), combined with particle tracking velocimetry (Kähler et al. 2012), variational adaptive Gaussian interrogation window (Becker et al. 2012), and adjusting the interrogation window adaptively according to seeding density and velocity information (Theunissen et al. 2007, 2010; Yu and Xu 2016; Simonini et al. 2019). Because of the smoothing effect of the interrogation window on the velocity field, the estimation error of the cross-correlation-based method is relatively large in regions with large velocity gradients, such as shock waves, recirculation areas, shear flow and strong vortices (Seong et al. 2019).

An alternative to the cross-correlation-based method is the optical flow-based method, which was originally applied in the computer vision field. Compared to the cross-correlation-based method, which provides a sparse velocity field (one velocity vector for each interrogation window), the optical flow-based method enables the estimation of the dense velocity field (one velocity vector for each pixel). First proposed by Horn and Schunck (1981), the original optical flow formulation depends on an objective function composed of a data term and a regularization term. The data term is associated with the brightness constancy assumption, which assumes that a given point retains the same intensity in the image plane along its trajectory. To cope with the under-constrained vectorial estimation problem (i.e., aperture problem in the computer vision field), a regularization term (based on the smoothness constancy assumption) is added in the optical flow formulation. Over the past 20 years, the original optical flow formulation proposed by Horn and Schunck (1981) has been extended to various revised optical flow-based methods for fluid flow motion estimation. Quénot et al. (1998) proposed an optical flow technique based on dynamic programming constraints, which was the first application of the optical flow-based method in PIV. The multi-resolution optical flow approach proposed by Ruhnau et al. (2005) is a continuous variational formulation for globally estimating the dense velocity field from particle images. Zhong et al. (2017) modified the brightness constancy to the brightness gradient constancy to resist the influence of the illumination variation in the experiment.

However, these approaches usually rely on computer vision theory and are not rigorously derived from the fundamental equations of fluid mechanics. Therefore, to more reasonably apply optical flow to fluid flow measurements, it is necessary to establish optical flow formulations based on the theory of fluid mechanics (Heitz et al. 2010). Corpetti et al. (2000, 2002, 2006) presented a fluid-flow dedicated formulation based on the integrated continuity equation, which is derived from the Reynolds transport equation of fluid in the image plane. Liu and Shen (2008) built a quantitative connection between the optical flow and the fluid flow for various flow visualizations and proposed a physics-based optical flow method to provide a rational foundation for applying the optical flow method to PIV measurements (Liu et al. 2015). In this context, more data terms in the optical flow formulation are combined with the fundamental equations of fluid mechanics, such as the eddy-diffusivity model (Cassisa et al. 2011) and the transport equation of turbulent flow (Chen et al. 2015; Cai et al. 2018), to improve the performance in estimating fluid flow motion. In addition to data terms based on the physics of fluid flow, various modifications to the regularization term have also been frequently proposed. Among the recently developed optical flow methods, the regularization term is usually formulated in the forms of a high-order constraint (Corpetti et al. 2006; Liu and Ribeiro 2011; Lu et al. 2019), orthogonal decomposition (Yuan et al. 2007), wavelet expansion (Kadri-Harouna et al. 2013; Dérian et al. 2011, 2013; Schmidt and Sutton 2019, 2020) or physical constraint (Kohlberger et al. 2003; Ruhnau and Schnörr 2007; Heitz et al. 2008; Chen et al. 2015; Cai et al. 2018). These works indicate that the combination of the physics of fluid flow and optical flow schemes is a very promising direction. However, optical flow methods are not without their potential drawbacks. Compared to the cross-correlation-based method, optical flow methods may exhibit difficulties with experimental noise or illumination variation that commonly occur in experiments. Moreover, the regularization parameters of most optical flow methods have no physical interpretation and are previously tuned empirically. However, the regularization parameters with physical interpretation can be optimally set and are more suitable for optical flow methods dedicated to fluid flow (Cai et al. 2018).

The objectives of this work are to present an optical flow method for processing particle image sequences that addresses the potential drawbacks listed above. The main ideas and contributions of this work consist of proposing a novel optical flow formulation by considering both particle image information and physics theory of fluid flow. According to the Helmholtz velocity decomposition theorem, the proposed optical flow method decomposes the two-dimensional velocity field into four components: translation motion, linear distortion motion, shear distortion motion and rotation motion. In this context, regularization terms for different motion components are designed, which have a reasonable physical interpretation for the flow characteristics of the fluid. Subsequently, we design specific regularization parameters for the corresponding regularization terms according to the flow characteristics of the motion components. These regularization parameters can be adaptively adjusted with changes in the image space and velocity field. In addition, the data term of the optical flow formulation is based on the projected-motion equation derived from the continuity equation, which protects the compressibility of the fluid in the two-dimensional plane. A bilateral filter kernel function is used to resist image noise and illumination changes in the experiment. The proposed velocity decomposition-based variational optical flow method (VD-VOF) is based on the continuity equation and Helmholtz decomposition theorem. It is applicable not only to turbulent or incompressible flow but also to more flow conditions.

The rest of this paper is organized as follows. In Sect. 2, the optical flow formulation under fluid velocity decomposition is presented in detail. Then, the discretization scheme and multiscale technique are described in Sect. 3. Experimental evaluations on synthetic images and real data are demonstrated in Sects. 4 and 5, respectively. Comparisons with other fluid motion estimation techniques are also discussed in these sections. Finally, a conclusion is discussed in Sect. 6.

2 Methodology

In this section, Helmholtz velocity decomposition is first introduced in detail. Subsequently, regularization terms dedicated to Helmholtz decomposition and the velocity decomposition-based optical flow method are presented and discussed.

2.1 Helmholtz velocity decomposition

The Helmholtz velocity decomposition states that a velocity field can be uniquely decomposed into a sum of a translational component, a divergence-free (solenoidal) component and a curl-free (irrotational) component. Such a decomposition simplifies the analysis of flow fields since important properties of flow representing physical phenomena such as incompressibility and vorticity can be studied on the decomposed components directly. The Helmholtz decomposition has been proved to be an important tool for fluid analysis and one of the fundamental theorems of fluid dynamics (Bhatia et al. 2013). It has been used by various research communities for a wide variety of applications, such as weather modelling, oceanology, and geophysics (McWilliams 2006). Under the zero boundary condition, the translational component can be ignored, and the vector field can be expressed as a sum of the gradient of a stream potential and the curl of a velocity potential (Kohlberger et al. 2003). This implicit Helmholtz decomposition has been used for the optical flow method in the literature (Corpetti et al. 2002, 2006; Kohlberger et al. 2003; Yuan et al. 2007) and is different from the explicit Helmholtz decomposition into four components involved in the current work.

Let \({{\varvec{x}}} = {\left( {x,y} \right) ^T}\) denote the coordinate location of a point in the two-dimensional velocity field plane; \({{\varvec{u}}}({{\varvec{x}}}) = {\left( {u({{\varvec{x}}}),v({{\varvec{x}}})} \right) ^T}\) is the velocity vector at location \({\varvec{x}}\), and \({{\varvec{x}}} + \delta {{\varvec{x}}}\) is a neighbouring point near \({\varvec{x}}\) with the velocity vector \({{\varvec{u}}}({{\varvec{x}}} + \delta {{\varvec{x}}})\). If the distance \(\delta {{\varvec{x}}} = {\left( {\delta x,\delta y} \right) ^T}\) between the point \({\varvec{x}}\) and the point \({{\varvec{x}}} + \delta {{\varvec{x}}}\) is small enough, by applying the first-order Taylor expansion, the following equations can be obtained:

$$\begin{aligned} {{\varvec{u}}}({{\varvec{x}}} + \delta {{\varvec{x}}}) = {{\varvec{u}}}({{\varvec{x}}}) + \frac{{\partial {{\varvec{u}}}}}{{\partial x}}\delta x + \frac{{\partial {{\varvec{u}}}}}{{\partial y}}\delta y. \end{aligned}$$
(1)

The detailed expression is as follows:

$$\begin{aligned} \delta {{\varvec{u}}}({{\varvec{x}}}) = \frac{{\partial {{\varvec{u}}}}}{{\partial x}}\delta x + \frac{{\partial {{\varvec{u}}}}}{{\partial y}}\delta y = {{\varvec{\chi }}} \cdot \delta {{\varvec{x}}} + {{\varvec{\theta }}} \cdot \delta {{\varvec{x}}} + {{\varvec{\zeta }}} \cdot \delta {{\varvec{x}}}, \end{aligned}$$
(2)
$$\begin{aligned} \begin{array}{*{20}{c}} {{{\varvec{\chi }}} = \left[ {\begin{array}{*{20}{c}} {{\varepsilon _{xx}}}&{}0\\ 0&{}{{\varepsilon _{yy}}} \end{array}} \right] }&{},&{}{\begin{array}{*{20}{c}} {{{\varvec{\theta }}} = \left[ {\begin{array}{*{20}{c}} 0&{}{{\varepsilon _{xy}}}\\ {{\varepsilon _{xy}}}&{}0 \end{array}} \right] }&{},&{}{{{\varvec{\zeta }}} = \left[ {\begin{array}{*{20}{c}} 0&{}-\omega \\ \omega &{}0 \end{array}} \right] } \end{array}} \end{array}, \end{aligned}$$
(3)

where \({\varvec{\chi }}\), \({\varvec{\theta }}\), \({\varvec{\zeta }}\) denote the linear distortion rate tensor, shear distortion rate tensor, and rotation tensor, respectively; \({\varepsilon _{xx}} = {{\partial u}/{\partial x}}\) and \({\varepsilon _{yy}} = {{\partial v}/ {\partial y}}\) are the linear distortion rates in the x and y directions, respectively; \({\varepsilon _{xy}} = {{\left( {{{\partial u} /{\partial y}} + {{\partial v} / {\partial x}}} \right) }/2}\) is the shear distortion rate; and \(\omega = {{\left( {{{\partial v}/ {\partial x}} - {{\partial u}/ {\partial y}}} \right) }/ 2}\) is the rotation angular rate. Therefore, Eq. 1 can be derived as:

$$\begin{aligned} {{\varvec{u}}}({{\varvec{x}}} + \delta {{\varvec{x}}}) = {{\varvec{u}}}({{\varvec{x}}}) + {{\varvec{\chi }}} \cdot \delta {{\varvec{x}}} + {{\varvec{\theta }}} \cdot \delta {{\varvec{x}}} + {{\varvec{\zeta }}} \cdot \delta {{\varvec{x}}}. \end{aligned}$$
(4)

On the right-hand side of Eq. 4, the first term represents the translation motion of the fluid particle from point \({\varvec{x}}\) to point \({{\varvec{x}}} + \delta {{\varvec{x}}}\) at velocity \({{\varvec{u}}}({{\varvec{x}}})\), and the following three terms represent linear deformation motion, shear deformation motion and rotation motion. In this way, the velocity vector \({{\varvec{u}}}({{\varvec{x}}} + \delta {{\varvec{x}}})\) at point \({{\varvec{x}}} + \delta {{\varvec{x}}}\) can be decomposed into four components, which is the explicit function of Helmholtz velocity decomposition. There are two important differences between Helmholtz velocity decomposition and general rigid object velocity decomposition: fluid motion has one more deformation velocity component than rigid object motion; rigid object velocity decomposition is valid for the entire rigid body, while Helmholtz velocity decomposition is valid only within a fluid particle and is a local theorem.

2.2 Regularization term based on Helmholtz velocity decomposition

To address the under-constrained vectorial estimation problem in the optical flow formulation, a classical regularization term was proposed in the seminal work of Horn and Schunck (1981). The regularization term proposed by Horn and Schunck (1981) is based on the smoothness constancy assumption that all neighbouring points have similar motions and is expressed as the magnitude of the first-order velocity gradient:

$$\begin{aligned} \int _\Omega {\left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y}, \end{aligned}$$
(5)

where \(\nabla\) is the gradient operator in two-dimensional directions, and \(\Omega\) denotes the two-dimensional image domain. Hereafter, the coordinate location of a point in the velocity field plane is equivalent to the pixel coordinate in the image domain, defined as \({{\varvec{x}}} = {\left( {x,y} \right) ^T}\), and the velocity vector is equivalent to the optical flow vector, defined as \({{\varvec{u}}}({{\varvec{x}}}) = {\left( {u({{\varvec{x}}}),v({{\varvec{x}}})} \right) ^T}\). This classical first-order regularization term is actually the first-order Tikhonov regularization for ill-posed problems (Liu and Shen 2008) and has been used in the physics-based optical flow method proposed by Liu et al. (2015). Furthermore, this regularization term can be interpreted as derived from a homogeneous divergence-free uncertainty random field and has been extended with a small-scale diffusion tensor in Cai et al. (2018).

It has been demonstrated that the classical first-order regularization term (Eq. 5) is equivalent to the first-order div-curl regularization term, which is the smoothing penalization of the magnitude of divergence and vorticity (Corpetti et al. 2006):

$$\begin{aligned} \int _\Omega {\left( {{{\left| {\mathrm{{div}}\,{{\varvec{u}}}} \right| }^2} + {{\left| {\mathrm{{curl}}\,{{\varvec{u}}}} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y}, \end{aligned}$$
(6)

where \(\mathrm{{div}}\,{{\varvec{u}}}\) and \(\mathrm{{curl}}\,{{\varvec{u}}}\) are the divergence and vorticity of the velocity field, respectively. Generally, the regularization term in the optical flow cost functional is set from a regularity condition on the solution. However, such first-order regularization terms are particularly suited for rigid movement and are difficult to relate to kinematical or dynamical properties of the fluid (Chen et al. 2015). To protect the key information contained in the vorticity field of fluid motion, Chen et al. (2015) simplified the first-order divergence-curl regularization term to the penalization of the magnitude of divergence, which addresses 2D incompressible turbulent flows only.

Compared with general stable object motion, fluid motion has additional deformation velocity components, so that the fluid velocity field normally exhibits areas with high values of vorticity and divergence. The underestimation of deformation movement may become a source of error for velocity field estimation. In this case, higher-order regularization terms are considered, and the third derivatives of the velocity field have been used in the wavelet domain by Schmidt and Sutton (2019). Another more commonly used higher-order regularization term is the second-order div-curl regularization term proposed by Corpetti et al. (2006), which minimizes the gradients of the divergence and the vorticity:

$$\begin{aligned} \int _\Omega {\left( {{{\left| {\nabla \,\mathrm{{div}}\,{{\varvec{u}}}} \right| }^2} + {{\left| {\nabla \,\mathrm{{curl}}\,{{\varvec{u}}}} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y}. \end{aligned}$$
(7)

This regularization term is consistent with the physical properties of fluid flows. Schmidt and Sutton (2020) implemented it in the wavelet domain and has achieved better results than the third-order velocity gradient regularization term (Schmidt and Sutton 2019). Kohlberger et al. (2003) used the third derivatives of the stream potential and velocity potential in the implicit Helmholtz decomposition as the regularization term, which ignored the translation component of the fluid flow. These works indicate that higher-order regularization terms with physical properties of fluid flow can obtain more accurate velocity estimations.

However, these optical flow methods completely ignore the image intensity information when establishing the regularization term, which is not advisable in the optical flow method in the computer vision field (Sun et al. 2014). In the current work, we use Helmholtz decomposition to design a new regularization term, which considers not only the flow characteristics of the fluid but also the image information. This new regularization term enforces a smoothing constraint not on the velocity field \({{\varvec{u}}}\) itself but only on four motion components we are interested in. The explicit function of Helmholtz decomposition is used to combine the physical properties of the fluid flow with the image information within reasonable assumptions.

First, we consider only fluid flow characteristics and use the following notations:

$$\begin{aligned} {\left| {\nabla {{\varvec{u}}}} \right| ^2}:= & {} {\left| {\nabla u} \right| ^2} + {\left| {\nabla v} \right| ^2}, \end{aligned}$$
(8)
$$\begin{aligned} {\left| {\nabla {{\varvec{\chi }}}} \right| ^2}:= & {} {\left| {\nabla {\varepsilon _{xx}}} \right| ^2} + {\left| {\nabla {\varepsilon _{yy}}} \right| ^2}, \end{aligned}$$
(9)
$$\begin{aligned} {\left| {\nabla {{\varvec{\theta }}}} \right| ^2}:= & {} 2{\left| {\nabla {\varepsilon _{xy}}} \right| ^2}, \end{aligned}$$
(10)
$$\begin{aligned} {\left| {\nabla {{\varvec{\zeta }}}} \right| ^2}:= & {} 2{\left| {\nabla \omega } \right| ^2}. \end{aligned}$$
(11)

After the Helmholtz decomposition, the four motion components of fluid flow are smoothly constrained. From the previous velocity decomposition equation (Eq. 4) in Sect. 2.1, a novel regularization term for optical flow estimation can be proposed:

$$\begin{aligned} \int _\Omega {\left( {{{\left| {\nabla {{\varvec{u}}}} \right| }^2} + {{\left| {\nabla {{\varvec{\chi }}}} \right| }^2} + {{\left| {\nabla {{\varvec{\theta }}}} \right| }^2} + {{\left| {\nabla {{\varvec{\zeta }}}} \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y \end{aligned}$$
(12)

where the translation motion \({\varvec{u}}\), linear distortion rate tensor \({\varvec{\chi }}\), shear distortion rate tensor \({\varvec{\theta }}\) and rotation tensor \({\varvec{\zeta }}\) are smoothly constrained. Substituting Eqs. 811 into Eq. 12, we obtain the following formulation:

$$\begin{aligned}&\int _\Omega {\left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2} + {{\left| {\nabla {\varepsilon _{xx}}} \right| }^2} + {{\left| {\nabla {\varepsilon _{yy}}} \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {\left( {{{2\left| {\nabla {\varepsilon _{xy}}} \right| }^2} + {{2\left| {\nabla \omega } \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y. \end{aligned}$$
(13)

However, such a regularization term does not accommodate discontinuities in the velocity field. To capture locally non-smooth motion, such as shock waves, it is necessary to allow outliers in the regularization term (Sun et al. 2014). This can be achieved by a non-quadratic penalty function \(\psi \left( s^2 \right) = \sqrt{{s^2} + {\tau ^2}}\). The symbol \(\tau\) is a prefixed small constant that is usually set as \(\tau = 0.001\) to ensure that \(\psi \left( s^2 \right)\) is strictly convex. The use of the non-quadratic penalty function ensures a unique solution to the minimization problem and allows the construction of simple global convergence algorithm. In this way, a piecewise smooth flow field is modelled, and we propose the minimisation of the following formulation:

$$\begin{aligned}&\int _\Omega {\psi \left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {\left( {\psi \left( {{{\left| {\nabla {\varepsilon _{xx}}} \right| }^2}} \right) + \psi \left( {{{\left| {\nabla {\varepsilon _{yy}}} \right| }^2}} \right) } \right) } \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {\left( {2\psi \left( {{{\left| {\nabla {\varepsilon _{xy}}} \right| }^2}} \right) + 2\psi \left( {{{\left| {\nabla \omega } \right| }^2}} \right) } \right) } \mathrm{{d}}x\mathrm{{d}}y. \end{aligned}$$
(14)

On the basis of Eq. 14, we add the image intensity information to construct an image-driven self-adaptive regularization parameter to mitigate the regularization at flow motion boundaries. In supersonic or hypersonic flow, there are discontinuous flow structures such as shock wave, expansion wave, and shear layer (Lu et al. 2019). The abrupt change in velocity between the fluid and the wall can also be regarded as discontinuous. Here, we regard these discontinuous flow structures as flow motion boundaries, similar to image edges. In the regions of the flow motion boundaries, the fluid density changes abruptly, causing a corresponding change in the average concentration of tracer particles. This is reflected in the particle image in which the image intensity changes drastically in the regions of the flow motion boundaries and forms the image edges (Zhong et al. 2017). The self-adaptive regularization parameter \({{e^{-{{\left| {\nabla I} \right| }^2 }}}}\) is based on a monotonically decreasing function of the magnitude of the image gradient, and it respects flow motion boundaries (Drulea and Nedevschi 2011). In the regions with uniform change in image intensity, this regularization parameter increases, while in the regions of the image edges, this regularization parameter automatically decreases, so that the flow motion boundaries can be protected from oversmoothing and blurring.

In addition to translation motion, linear deformation and shear deformation motion, rotation motion exists in the shock wave, shear layer and vortex structure. However, the image edge of the vortex structure in turbulent flow is not obvious. To further improve the optical flow performance in the region of the vortex structure, a vorticity bilateral filter is added as a regularization parameter of the rotation tensor constraint. The bilateral filter consists of a Gaussian (space) filter and a range (vorticity) filter (Lin et al. 2014):

$$\begin{aligned} {BF_\omega }&= {G_s} \cdot {G_\omega } \nonumber \\&= \mathrm{{exp}}\left( { - \frac{{{{\left| {{{\varvec{x}}} - {{{\varvec{x}}}_0}} \right| }^2}}}{{2{\sigma _s}}}} \right) \cdot \mathrm{{exp}}\left( { - \frac{{{{\left| {{\omega _{{\varvec{x}}}} - {\omega _{{{{\varvec{x}}}_0}}}} \right| }^2}}}{{2{\sigma _\omega }}}} \right) , \end{aligned}$$
(15)

where \({G_s}\) denotes the spatial Gaussian filter of size \(\rho\) and with standard deviation \(\sigma _s\), and \({G_\omega }\) denotes the vorticity Gaussian filter of size \(\rho\) and with standard deviation \(\sigma _\omega\). The weight of a pixel \({\varvec{x}}\) decreases as the distance from the centre \({{\varvec{x}}}_0\) of the filter kernel increases. In addition, the weight decreases if the vorticity \(\omega _{{\varvec{x}}}\) of the pixel \({\varvec{x}}\) is different from the filter kernel centre’s vorticity \(\omega _{{{{\varvec{x}}}_0}}\). The vorticity bilateral filter considers the spatial distance and vorticity difference between the pixel and its neighbouring pixels to better protect the vortex structure.

The improved regularization term, which includes the non-quadratic penalty function, a bilateral filter kernel function and a self-adaptive parameter based on the image gradient, is proposed as follows:

$$\begin{aligned} {E_{reg}}&= \int _\Omega {{e^{ - {{\left| \! {\nabla \!I} \!\right| }^2}}}} \psi \left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+\! \int _\Omega \! {{e^{ - {{\!\left| \!{\nabla \! I} \right| }^2}}}\left( {\psi \! \left( {{{\left| {\nabla {\varepsilon _{xx}}} \right| }^2}} \right) + \psi \! \left( {{{\left| {\nabla {\varepsilon _{yy}}} \right| }^2}} \right) } \right) } \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+\! \int _\Omega \! {\left( \! {{2e^{ \!- \!{{\left| \!{\nabla \! I}\! \right| }^2}}}\psi \! \left( \! {{{\left| \! {\nabla {\varepsilon _{xy}}} \!\right| }^2}} \!\right) \!+\! 2{BF_\omega } \!* \!\psi \! \left( {{{\left| {\nabla \omega } \right| }^2}} \right) } \right) } \mathrm{{d}}x\mathrm{{d}}y, \end{aligned}$$
(16)

where \(*\) denotes the convolution operation. Compared to the classical regularization term, the proposed regularization term considers both particle image information and physics theory of fluid flow. According to the Helmholtz velocity decomposition, the proposed optical flow method decomposes the two-dimensional velocity field into four components: translation motion, linear distortion motion, shear distortion motion and rotation motion. In this context, regularization terms for different motion components are designed, which have a reasonable physical interpretation for the fluid flow. Subsequently, a non-quadratic penalty function is used to capture the locally non-smooth motion. In addition, we design the specific regularization parameters for the corresponding regularization terms according to the flow characteristics of the motion components. The monotonically decreasing function \({{e^{-{{\left| {\nabla I} \right| }^2 }}}}\) automatically changes according to the image intensity to protect the flow motion boundaries from being over-smoothed. The vorticity bilateral filter \(BF_\omega\) automatically changes according to the vorticity field to protect the vortex structure. These regularization parameters can be adaptively adjusted with changes in the image space and velocity field.

2.3 Velocity-decomposition-based optical flow

Optical flow-based PIV methods estimate the motion between two sequential particle images taken at times t and \(t + \mathrm{{d}}t\) at every pixel position. When \(I({\varvec{x}},t)\) is the intensity of the particle image obtained at time t, and the position \(({\varvec{x}}, t)\) is moved by \(\mathrm{{d}}{\varvec{x}}\) and \(\mathrm{{d}} t\) between the two images, the intensity of these two pixel points can generally be assumed to be invariable (Horn and Schunck 1981):

$$\begin{aligned} I\left( {{{\varvec{x}}},t} \right) \approx I\left( {{{\varvec{x}}} + \mathrm{{d}}{{\varvec{x}}},t+ \mathrm{{d}}t} \right) . \end{aligned}$$
(17)

The right-hand side of Eq. 17 can be expanded using the Taylor series, and the following basic optical flow equation can be obtained:

$$\begin{aligned} \frac{{\partial {I}}}{{\partial t}} + \nabla {I} \cdot {{\varvec{u}}} = 0, \end{aligned}$$
(18)

Corpetti et al. (2006) proposed the integrated continuity equation in the image plane as an alternative based on the Reynolds transport equation of fluid under the assumption that the image intensity is proportional to an integral of the fluid density across a measurement domain. The integrated continuity equation is expressed as follows:

$$\begin{aligned} \frac{{\partial {I}}}{{\partial t}} + \nabla {I} \cdot {{\varvec{u}}} + {I}\,\mathrm{{div}}\,{{\varvec{u}}} = 0. \end{aligned}$$
(19)

The projected-motion equations for typical flow visualizations were derived in the pivotal work of Liu and Shen (2008), and those authors showed that the optical flow \({\varvec{u}}\) is proportional to the path-averaged velocity of particles across the laser sheet. The physics-based optical flow equation proposed by Liu and Shen (2008) in the image plane is given by

$$\begin{aligned} \frac{{\partial {I}}}{{\partial t}} + \nabla \cdot \left( {{I{\varvec{u}}}} \right) = f({\varvec{x}},I), \end{aligned}$$
(20)

where \(f({{\varvec{x}}},{I}) = D{\nabla ^2}{I} + Dc{{\varvec{B}}} + c{{\varvec{n}}} \cdot (\Psi {{\varvec{u}}})|_{{\Gamma _1}}^{{\Gamma _2}}\), D is a diffusion coefficient, c is a coefficient for particle scattering/absorption, and \({\varvec{B}}\) is a boundary term related to the considered transported quantity \(\Psi\) and its derivatives coupled with the derivatives of the control surfaces confining the laser illumination volume. Because the control surfaces are planar, there is no particle diffusion through the molecular process, and the rate of particle accumulation in the laser illumination volume is ignored, the right-hand side term \(f({\varvec{x}},I)\) in Eq. 20 could be approximately equal to 0, and Eq. 20 is equivalent to Eq. 19 (Heitz et al. 2010). Then, the integrated continuity equation proposed by Corpetti et al. (2006) is consistent with the projected-motion equation presented by Liu and Shen (2008) in the case of a laser-sheet-illuminated particle image.

To acquire the compressible structures in the two-dimensional flow field, consistent with the objective of the proposed regularization term, the data term of the proposed optical flow method is based on the projected-motion equation derived from the continuity equation, which protects the compressibility of the fluid in the two-dimensional plane. A bilateral filter kernel function is used to resist image noise and illumination changes in the experiment (Lin et al. 2014). The data term of the VD-VOF estimation cost function is defined as follows:

$$\begin{aligned} {E_{data}} = \int _\Omega \! {{BF_I}\! * \!{{\left| {\frac{{\partial I}}{{\partial t}} \!+ \!\nabla I \cdot {{\varvec{u}}} \!+\! I\mathrm{{div}}\,{{\varvec{u}}}} \right| }^2}} \mathrm{{d}}x\mathrm{{d}}y, \end{aligned}$$
(21)

where \({BF_I} = {G_s}\cdot {G_I}\), \({G_s}\) and \({G_I}\) denote the spatial Gaussian filter and the intensity Gaussian filter, respectively. The weight of the bilateral filter is automatically adjusted according to the spatial distance and image intensity difference. As mentioned earlier, in the region of the flow motion boundary, the particle concentration changes drastically, and the image intensity changes accordingly. The data term with the bilateral filter is more sensitive to particle concentration, and the automatically adjusted weight can reduce the propagation or diffusion of the flow motion boundary, for example, to protect the shock wave from being oversmoothed or the boundary of the shear layer from being blurred. Furthermore, the spatial Gaussian filter in the bilateral filter can make the data term more robust, thereby resisting image noise.

Based on Eqs. 16 and 21, the model of the proposed VD-VOF method is as follows:

$$\begin{aligned} E&= \lambda {E_{data}} + {E_{reg}}\nonumber \\&= \lambda {\int _\Omega {{BF_I} * \left| {\frac{{\partial I}}{{\partial t}} + \nabla I \cdot {{\varvec{u}}} + I\mathrm{{div}}\,{{\varvec{u}}}} \right| } ^2}\mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {{e^{ - {{\left| {\nabla I} \right| }^2}}}} \psi \left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {{e^{ - {{\left| {\nabla I} \right| }^2}}}\left( {\psi \left( {{{\left| {\nabla {\varepsilon _{xx}}} \right| }^2}} \right) + \psi \left( {{{\left| {\nabla {\varepsilon _{yy}}} \right| }^2}} \right) } \right) } \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+\! \int _\Omega {\left( {{2e^{ - {{\left| {\nabla I} \right| }^2}}}\psi \!\left( {{{\left| {\nabla {\varepsilon _{xy}}} \right| }^2}} \right) \!+\! 2{BF_\omega } \!*\! \psi \! \left( {{{\left| {\nabla \omega } \right| }^2}} \right) } \right) } \mathrm{{d}}x\mathrm{{d}}y, \end{aligned}$$
(22)

where \(\lambda > 0\) is a smoothness parameter controlling the balance between the data term and the regularization term. The first two terms on the right side of the equation can be regarded as the modified model of the physics-based optical flow method proposed by Liu et al. (2015). The last two terms on the right side of the equation are constrained based on Helmholtz velocity decomposition and can also be seen as higher-order constraints of the velocity field. These two terms are often referred to as postprocessing constraints in the computer vision field.

3 Discretization and multiscale

In this section, the optimization strategies based on the discretization scheme and multiscale technique are first presented and discussed. Then, the complexity analysis and parameter settings are introduced in detail.

3.1 Discretization scheme

For the functional problem in Eq. 22, auxiliary variables are usually introduced to minimize the convex approximation of the original functional (Corpetti et al. 2006; Drulea and Nedevschi 2011; Lu et al. 2019). We introduce four auxiliary scalar fields, \({{{{\hat{\varepsilon }}} }_{xx}}\), \({{{{\hat{\varepsilon }}} }_{yy}}\), \({{{{\hat{\varepsilon }}} }_{xy}}\) and \({{\hat{\omega }}}\), which constitute direct estimates of the distortion rate and rotation rate. Then, the VD-VOF model is decomposed into five parts:

$$\begin{aligned}&{E_1}\left( {u,v,{\varepsilon _{xx}},{\varepsilon _{yy}},{\varepsilon _{xy}},\omega } \right) \nonumber \\&= \lambda {\int _\Omega {{BF_I} * \left| {\frac{{\partial I}}{{\partial t}} + \nabla I \cdot {{\varvec{u}}} + I\mathrm{{div}}\,{{\varvec{u}}}} \right| } ^2}\mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {{e^{ - {{\left| {\nabla I} \right| }^2}}}} \psi \left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y \nonumber \\&+ \int _\Omega {\left( {{{\left| {{\varepsilon _{xx}} - {{{{\hat{\varepsilon }}} }_{xx}}} \right| }^2} + {{\left| {{\varepsilon _{yy}} - {{{{\hat{\varepsilon }}} }_{yy}}} \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y} \nonumber \\&+ \int _\Omega {\left( {{{2\left| {{\varepsilon _{xy}} - {{{{\hat{\varepsilon }}} }_{xy}}} \right| }^2} + {{2\left| {\omega - {{\hat{\omega }}} } \right| }^2}} \right) \mathrm{{d}}x\mathrm{{d}}y}, \end{aligned}$$
(23)
$$\begin{aligned} {E_2}\left( {{{{{\hat{\varepsilon }}} }_{xx}}} \right)&= \int _\Omega {{e^{ - {{\left| {\nabla I} \right| }^2}}}\psi \left( {{{\left| {\nabla {{{{\hat{\varepsilon }}} }_{xx}}} \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y\nonumber \\&+ \int _\Omega {{{\left| {{\varepsilon _{xx}} - {{{{\hat{\varepsilon }}} }_{xx}}} \right| }^2}} \mathrm{{d}}x\mathrm{{d}}y, \end{aligned}$$
(24)
$$\begin{aligned} {E_3}\left( {{{{{\hat{\varepsilon }}} }_{yy}}} \right)&= \int _\Omega {{e^{ - {{\left| {\nabla I} \right| }^2}}}\psi \left( {{{\left| {\nabla {{{{\hat{\varepsilon }}} }_{yy}}} \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y\nonumber \\&+ \int _\Omega {{{\left| {{\varepsilon _{yy}} - {{{{\hat{\varepsilon }}} }_{yy}}} \right| }^2}} \mathrm{{d}}x\mathrm{{d}}y, \end{aligned}$$
(25)
$$\begin{aligned} {E_4}\left( {{{{{\hat{\varepsilon }}} }_{xy}}} \right)&= \int _\Omega {2{e^{ - {{\left| {\nabla I} \right| }^2}}}\psi \left( {{{\left| {\nabla {{{{\hat{\varepsilon }}} }_{xy}}} \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y\nonumber \\&+ \int _\Omega {{{2\left| {{\varepsilon _{xy}} - {{{{\hat{\varepsilon }}} }_{xy}}} \right| }^2}} \mathrm{{d}}x\mathrm{{d}}y, \end{aligned}$$
(26)
$$\begin{aligned} {E_5}\left( {{{\hat{\omega }}} } \right)&= \int _\Omega {2{BF_\omega } * \psi \left( {{{\left| {\nabla {{\hat{\omega }}} } \right| }^2}} \right) } \mathrm{{d}}x\mathrm{{d}}y\nonumber \\&+ \int _\Omega {{{2\left| {\omega - {{\hat{\omega }}} } \right| }^2}} \mathrm{{d}}x\mathrm{{d}}y. \end{aligned}$$
(27)

Because the distortion rate (\({\varepsilon _{xx}}\), \({\varepsilon _{yy}}\) ,\({\varepsilon _{xy}}\)) and the rotation rate \(\omega\) are the first-order differential forms of the velocity field (uv), the minimization problem of \({E_1}\left( {u,v,{\varepsilon _{xx}},{\varepsilon _{yy}},{\varepsilon _{xy}},\omega } \right)\) can be regarded as equivalent to that of \({E_1}\left( {u,v,{u _{x}},{u _{y}},{v_{x}},{v_{y}}} \right)\). This convex minimization problem can be optimized by alternating steps updating either (uv) or \(({{{{\hat{\varepsilon }}} }_{xx}},{{{{\hat{\varepsilon }}} }_{yy}},{{{{\hat{\varepsilon }}} }_{xy}},{{\hat{\omega }}} )\) in every iteration. For \(E_1\), \({{{{\hat{\varepsilon }}} }_{xx}}\), \({{{{\hat{\varepsilon }}} }_{yy}}\) ,\({{{{\hat{\varepsilon }}} }_{xy}}\) and \({{\hat{\omega }}}\) are considered fixed, and (uv) is unknown. The minimum of the energy model \(E_1\) can be found by solving the associated Euler-Lagrange equations, given by

$$\begin{aligned} 0&= \lambda {BF_I} * I{\delta _x}\left( {\frac{{\partial I}}{{\partial t}} + \nabla I \cdot {{\varvec{u}}} + I\mathrm{{div}}\,{{\varvec{u}}}} \right) \nonumber \\&+\! {e^{ - {{\left| {\nabla I} \right| }^2}}}\mathrm{{div}}\left( {{{\psi '}} \cdot \nabla u} \right) \!+ \!{\nabla ^2}u \!- \! {\delta _x}{{{{\hat{\varepsilon }}} }_{xx}} \!- \!{\delta _y}{{{{\hat{\varepsilon }}} }_{xy}} \!+\! {\delta _y}{{\hat{\omega }}}, \end{aligned}$$
(28)
$$\begin{aligned} 0&= \lambda {BF_I} * I{\delta _y}\left( {\frac{{\partial I}}{{\partial t}} + \nabla I \cdot {{\varvec{u}}} + I\mathrm{{div}}\,{{\varvec{u}}}} \right) \nonumber \\&+\! {e^{ - {{\left| {\nabla I} \right| }^2}}}\mathrm{{div}}\left( {{{\psi '}} \cdot \nabla v} \right) \!+ \!{\nabla ^2}v \!- \! {\delta _y}{{{{\hat{\varepsilon }}} }_{yy}} \!- \!{\delta _x}{{{{\hat{\varepsilon }}} }_{xy}} \!- \!{\delta _x}{{\hat{\omega }}}, \end{aligned}$$
(29)

with \(\psi '\left( {{s^2}} \right) = {1 / {\left( {2\sqrt{{s^2} + {\tau ^2}} } \right) }}\). To simplify the equations, we use the following notation:

$$\begin{aligned}&{\delta _x} := \frac{\partial }{{\partial x}} \nonumber \\&{\delta _y} := \frac{\partial }{{\partial y}} \nonumber \\&{{\psi '}} := \psi '\left( {{{\left| {\nabla u} \right| }^2} + {{\left| {\nabla v} \right| }^2}} \right) . \end{aligned}$$
(30)

The Euler-Lagrange equations as expressed in Eqs. 28 and 29 can be solved by Gauss-Seidel iteration or successive over relation (SOR) iteration. The details of the numerical algorithm for solving the above equations, Eqs. 28 and 29, have been derived in detail in Sánchez et al. (2013), and we do not discuss this process further here.

For the minimum of the energy model Eqs. 2427, the numerical schemes are expected to be similar. Taking \(E_2\) as an example, \({{{{\hat{\varepsilon }}} }_{xx}}\) is unknown, and (uv) and \({{\varepsilon }_{xx}}\) are considered fixed. To make this problem easier to solve, we modify the penalty function \(\psi \left( {{s^2}} \right)\) to the L1 norm as follows:

$$\begin{aligned} {E_2}\left(\!{{{{{\hat{\varepsilon }}} }_{xx}}}\!\right)\!=\! \int _\Omega\! {{e^{\!-\!{{\left|{\nabla I}\right| }^2}}}\!\left|\!{\nabla{{{{\hat{\varepsilon }}} }_{xx}}}\!\right|} \mathrm{{d}}x\mathrm{{d}}y \!+\! \int _\Omega\! {{{\left|\!{{\varepsilon _{xx}}\!-\!{{{{\hat{\varepsilon }}} }_{xx}}}\!\right| }^2}} \mathrm{{d}}x\mathrm{{d}}y. \end{aligned}$$
(31)

The Euler-Lagrange equation for Eq. 31 is

$$\begin{aligned} - \mathrm{{div}}\left( {{e^{ - {{\left| {\nabla I} \right| }^2}}}\frac{{\nabla {{{{\hat{\varepsilon }}} }_{xx}}}}{{\left| {\nabla {{{{\hat{\varepsilon }}} }_{xx}}} \right| }}} \right) + {{2{{\hat{\varepsilon }}} }_{xx}} - {2\varepsilon _{xx}} = 0, \end{aligned}$$
(32)

which can be solved using a fixed-point iteration scheme. The details of the numerical algorithm for solving Eq. 32 have been derived in detail in Drulea and Nedevschi (2011); as before, we do not discuss this process further here.

3.2 Multiscale strategy

Generally, one typical weakness is that optical flow methods require small displacements to achieve sufficient accuracy because of the condition for establishing the Taylor series linearization (Heitz et al. 2010). In the case of a large displacement between two sequential particle images, the discordance between the temporal derivative and the spatial gradient in the image plane may lead to poor velocity estimations. To address this, optical flow methods are typically embedded into a sequential coarse-to-fine multiscale strategy, which has been proved effective for improving the estimation range of optical flow estimations in the literature (Heitz et al. 2008, 2010; Chen et al. 2015; Cai et al. 2018; Lu et al. 2019).

figure b

The main idea of this strategy is the image pyramid structure and image warping operation and is divided into the following steps: (a) an image pyramid structure of a particle image pair is constructed by a series of low-pass filters and a downsampling process on the image such that the resolutions of the images in the pyramid are successively reduced; (b) the principal component displacements are estimated from the coarse-resolution level and then projected onto the next finer resolution level of the image pyramid, and the incremental displacements are then estimated while going down the image pyramid; and (c) an image warping operation is performed iteratively at each pyramid level so that only small displacement increments are estimated in each image warping operation.

In the image warping iteration process, let \({\varvec{u_0}}\) denote the displacement field transferred from the previous warping iteration. Then, a warped intermediate image \(I_w(t+\Delta {t})=I({\varvec{x}}+{\varvec{u_0}}\Delta {t},t+\Delta {t})\) is obtained by warping the second image \(I({\varvec{x}}+{\varvec{u}}\Delta {t},t+\Delta {t})\) to the first image \(I({\varvec{x}},t)\) with \({\varvec{u_0}}\). In the current warping iteration, the small displacement increment \(\delta {{\varvec{u}}}\) is estimated between the first image and the warped image rather than the second image. Finally, the updated \({\varvec{u_0}}={\varvec{u_0}}+\delta {{\varvec{u}}}\) is transferred to the next warping iteration. As the warping iteration progresses, \(\delta {{\varvec{u}}}\) gradually approaches 0, \({\varvec{u_0}}\) gradually approaches \({\varvec{u}}\), and the intermediate image \(I_w(t+\Delta {t})\) gradually approaches the first image \(I({\varvec{x}},t)\). The framework of the minimization process of the proposed VD-VOF method is shown in Algorithm 1 with the image pyramid structure and image warping operation.

3.3 Complexity analysis and parameter settings

Complexity analysis is a common technique to compare the computational efficiency of different methods and has been used in the optical flow method literature (Kadri-Harouna et al. 2013; Lu et al. 2019; Schmidt and Sutton 2020). Assuming that the resolution of the particle image is \(N \times N\), for the space complexity, the proposed VD-VOF method saves the image pyramid \({I^t}pyr\{k\}\), the corresponding velocity field (uv) and auxiliary scalar fields \(({{{{\hat{\varepsilon }}} }_{xx}},{{{{\hat{\varepsilon }}} }_{yy}},{{{{\hat{\varepsilon }}} }_{xy}},{{\hat{\omega }}} )\) at runtime, and its space complexity is \(K\times N^2 = O(N^2)\). In the image warping operation, the space complexity is \(K\times L \times N^2 = O(N^2)\) (the image size N is much larger than the layer of image pyramid K and the number of warping iterations L). Therefore, the space complexity of the proposed VD-VOF method is \(O(N^2)\). For the time complexity, the calculation of \((I_x,I_y,I_t)\) is related to the image resolution \(N \times N\), and the time complexity is \(O(N^2)\). The calculation of \(\left( {\delta u,\delta v} \right)\) consists of iteratively solving partial differential equations Eqs. 28 and 29, the number of SOR iterations P is generally close to N, and the corresponding time complexity is \(O(N^3)\). In the calculation of the auxiliary scalar fields \(({{{{\hat{\varepsilon }}} }_{xx}},{{{{\hat{\varepsilon }}} }_{yy}},{{{{\hat{\varepsilon }}} }_{xy}},{{\hat{\omega }}} )\) using Eq. 32 with fixed-point iteration, the number of fixed-point iterations is also close to N, and the corresponding time complexity is \(O(N^3)\). Therefore, the time complexity of the proposed VD-VOF method is \(O(N^3)\).

The range of the smoothness weight parameter is approximately \(2000 \le \lambda \le 4000\). The size of the bilateral kernel is 5 pixels, the standard deviation for the space Gaussian is 0.85, and the standard deviation for the image intensity Gaussian and vorticity Gaussian is 0.1 (the image and vorticity intensities are normalized within \(\left[ 0,1 \right]\)). The number of image warping iterations L is fixed to 5, the image warping interpolation method is the bicubic interpolation method, and the number of alternating iterations R is fixed to 10. The number of SOR iterations P is fixed to 200, and the number of fixed-point iterations Q is fixed to 200. The number of pyramid layers is approximately \(2 \le K \le 5\), chosen based on the image size and fluid velocity, and the scale factor \(\eta\) for downsampling is set to 0.5.

4 Evaluations of synthetic data

In this section, different synthetic image sequences are used to investigate the performance of the proposed VD-VOF method. The main advantage of testing on synthetic image sequences is that the true velocity field is known and can be used for comparison with the velocity field estimated by different methods. Although these synthetic image sequences are usually generated under different ideal conditions, they are quite suitable for evaluating the performance of different PIV measurement methods. A real experimental tracer particle image sequence is tested and discussed in the next section. The estimated velocity field from the VD-VOF method is compared against the true velocity field, as well as velocity estimations using a multiple-pass cross-correlation estimation (Insight 4G, TSI Inc.), the classical H & S R+S estimation by Ruhnau et al. (2005), the physics-based estimation by Liu (2017), the field-segmentation-based estimation by Lu et al. (2019), and the stochastic model estimation by Cai et al. (2018). The parameter settings of all compared approaches are described in detail in our previous work (Lu et al. 2019), and we do not discuss this process further here.

Hereafter, we follow a standard way to quantitatively evaluate the experimental results by computing the root mean square error (RMSE) and average angle error (AAE) over N pixels of the image:

$$\begin{aligned} \mathrm{{RMSE}} = {\sqrt{\frac{1}{N}\sum \limits _{i = 1}^N {{{\left| {{{{\varvec{u}}}_i^t} - {{{\varvec{u}}}_i^e}} \right| }^2}} }}, \end{aligned}$$
(33)
$$\begin{aligned} \mathrm{{AAE}} = \frac{1}{N}\sum \limits _{i = 1}^N {\arccos \left( {\frac{{{{\varvec{u}}}_i^t \cdot {{\varvec{u}}}_i^e}}{{\left| {{{\varvec{u}}}_i^t} \right| \left| {{{\varvec{u}}}_i^e} \right| }}} \right) }, \end{aligned}$$
(34)

where \({\varvec{u}}^t=(u^t,v^t)\) and \({\varvec{u}}^e=(u^e,v^e)\) denote the ground truth and the estimated velocity field, respectively. N represents the total number of pixels of the estimated particle image, and the index i represents the pixel position where the velocity is computed. RMSE and AAE are commonly used as the evaluation criteria in the velocity estimation of fluid flow (Chen et al. 2015; Cai et al. 2018; Lu et al. 2019). To avoid the influence of errors caused by the matrix extrapolation, the velocity values of the widths of the three pixels around the image are ignored when calculating RMSE and AAE. Moreover, the spectrum analysis of the velocity field is introduced to evaluate the estimated flow structure, which is also a common evaluation in fluid flow motion estimation (Heitz et al. 2010; Schmidt and Sutton 2019, 2020). This evaluation criterion can be used not only for simulation data but also for experimental data. Therefore, we compare the proposed method with other approaches based on these evaluation criteria.

Fig. 1
figure 1

The ground-truth velocity fields for the analytic flows: a Poiseuille flow; b Lamb-Oseen vortex; c uniform flow; d sink flow; e vortex flow; f potential flow around a cylinder with circulation

Fig. 2
figure 2

RMSE (a) and AAE (b) errors of velocity for analytic flow particle image sequences estimated by different methods: \(\#01\) Poiseuille flow; \(\#02\) Lamb-Oseen vortex; \(\#03\) uniform flow; \(\#04\) sink flow; \(\#05\) vortex flow; \(\#06\) potential flow around a cylinder with circulation

4.1 Analytic flows

These synthetic particle image data contain six different flows, which were generated by the Cemagref team (Carlier 2005). The analytic flows can be divided into two categories: viscous flows and potential flows. Viscous flows include Poiseuille flow and Lamb-Oseen vortex flow, which are two well-known examples with velocity gradients. Poiseuille flow is viscous flow between two parallel plates with a constant streamwise pressure gradient. The Lamb-Oseen vortex is a two-dimensional viscous flow with circular streamlines and a decreasing vorticity along the radial distance. The provided potential flows in the analytic flows data set are a uniform flow, a sink, a vortex and a potential flow around a cylinder with circulation. For each of the analytic flows, 41 successive images are given with the same parameters (particle size, concentration, intensity); the corresponding ground-truth velocity fields of the six different flows are presented in Fig. 1.

Fig. 3
figure 3

Illustration of a sample frame (t = 50) from the 2D DNS synthetic image sequence: a particle image and b vorticity map with the ground-truth velocity field

Fig. 4
figure 4

Instantaneous vorticity field for the 2D DNS turbulent flow data set at t = 50 estimated by different methods: a result of multiple-pass cross-correlation; b result of H & S R\(+\)S estimation; c result of physics-based estimation; d result of FS-VOF estimation; e result of stochastic model estimation; f result of the proposed VD-VOF method

As shown in Fig. 2, quantitative comparisons of various PIV methods can be performed using the evaluation criteria RMSE and AAE. On these six synthetic particle images, the proposed VD-VOF method provides better results than the previous advanced optical flow methods. Compared to the original model (H & S R+S estimation), different data terms (physics-based estimation) and smoothing terms (FS-VOF estimation and stochastic model estimation) can be used to reduce the RMSE and AAE. Moreover, the addition of the regularization term based on Helmholtz velocity decomposition in the VD-VOF estimation is more effective in reducing the error. However, in the third data set \(\#03\) uniform flow, the calculation accuracy of the VD-VOF method is slightly lower than that of the multiple-pass cross-correlation method. This is because there is no velocity gradient in the uniform flow, and the multiple-pass cross-correlation method based on the interrogation window will achieve smoother results. In later experiments, we demonstrate that our algorithm has comprehensive advantages in terms of resolution and accuracy over the multiple-pass cross-correlation method.

4.2 2D DNS turbulent flow

This synthetic particle image data set is a 2D, homogeneous, isotropic and incompressible turbulent flow, which is generated by direct numerical simulation of the Navier-Stokes equations at Reynolds number \(Re = 3000\) and Schmidt number \(Sc = 0.7\). The details of the simulation and synthetic particle generation are described in Carlier and Wieneke (2005). This data set contains typical difficulties for PIV measurement methods such as high velocity gradients and a large dynamic range. It has been used by many researchers in the fluid measurement community, including in our previous work (Lu et al. 2019). The data set consists of 100 successive images at the resolution of \(256\times 256~\mathrm {pixels}\), and the maximum displacement between two successive images is approximately \(3.5~\mathrm {pixels}\). Fig. 3 demonstrates a particle image and the corresponding vorticity map with the ground-truth velocity field.

Fig. 5
figure 5

RMSE (a) and AAE (b) errors of velocity for the 2D DNS particle image sequence estimated by the different methods

The vorticity maps for a given instantaneous velocity field (at time t = 50) obtained by different methods are illustrated in Fig. 4. The corresponding velocity vectors are superimposed on each vorticity map, and the vorticity maps share a common colour legend. The bicubic interpolation method is used to interpolate the estimated velocity field of the multiple-pass cross-correlation method to obtain the same fine velocity field as the optical flow method. The vortex structures of different scales, which are comparatively blurred with the H & S R\(+\)S estimation and are slightly detected by the multiple-pass cross-correlation estimation and physics-based estimation, are substantially more accurately estimated with the FS-VOF estimation, stochastic model estimation and the proposed VD-VOF method such that the vortices have a similar behaviour to that of DNS. Upon carefully comparing the ground-truth vorticity map in Fig. 3b, at \(x=5~\mathrm {pixel}\), \(y=250~\mathrm {pixel}\), the FS-VOF and stochastic model estimations have an incorrect local vortex structure, but it does not exist in the vorticity map estimated by the VD-VOF method. We can observe from the vorticity maps that the proposed VD-VOF method performs better than the other methods, particularly in the area with high vorticity.

Fig. 6
figure 6

Spectrum analysis of the turbulent velocity for the 2D DNS particle image sequence, \(E\left( k\right)\) denotes the energy at a given frequency k

We present in Fig. 5 the RMSE and AAE curves of the velocity for the 2D DNS particle image sequences estimated from different methods. This comparison result suggests that the proposed VD-VOF method outperforms the multiple-pass cross-correlation and other advanced optical flow estimations. The turbulent energy spectra of these estimations are plotted in Fig. 6. All energy spectra generated by different methods are very close to the reference DNS spectrum at large scales. As clearly seen in Fig. 6, the proposed VD-VOF method performs much better than the other methods at small scales since the proposed method has introduced the velocity decomposition model and image-driven self-adaptive regularization parameter that can protect small-scale motions in the turbulent flow.

In order to further demonstrate the influence and contribution of each module in the proposed VD-VOF method, the modified physics-based estimation and the basic VD-VOF method were added as compared approaches. The modified physics-based estimation comprises the first two items in Eq. 22, and the basic VD-VOF method is the form of Eq. 22 without the regularization parameters \({{e^{-{{\left| {\nabla I} \right| }^2 }}}}\) and \(BF_\omega\). As shown in Fig. 7, both the regularization terms based on Helmholtz decomposition and the adaptive regularization parameters have effects on reducing RMSE and AAE errors, among which the former contribute more significantly. From these experiments, we can conclude that the proposed VD-VOF method is very well adapted to the estimation of fluid flows with high vorticity and small-scale motion. In the next section, we present some experiments on real data of a hypersonic compressible flow.

Fig. 7
figure 7

RMSE (a) and AAE (b) errors of velocity for the 2D DNS particle image sequence estimated by the modified physics-based estimation and the basic VD-VOF method

Fig. 8
figure 8

The particle image (a) and average velocity field (b) of hypersonic laminar flow over a \(40^ \circ\) compression ramp

5 Evaluations of experimental data

A Mach 5 hypersonic wind tunnel experiment was carried out to acquire the particle images of a compressible flow. The experiment was performed in the FD-30B hypersonic wind tunnel of the China Aerodynamics Research and Development Center (CARDC). The wind tunnel was operated at a total pressure \(p_0\) of \(0.5~\mathrm {MPa}\) and a total temperature \(T_0\) of \(350~\mathrm {K}\). A Quantel dual-cavity Nd:YAG-pulsed laser with a wavelength of \(532~\mathrm {nm}\), a maximum energy of \(430~\mathrm {mJ}\), a pulse rate of \(10~\mathrm {Hz}\) and a pulse duration of \(60~\mathrm {ns}\) was used. The particle images were recorded by a PowerView Plus 4MP-HS camera with a charge-coupled device (CCD) chip of \(2048 \times 2048~\mathrm {pixels}\) and a Nikon AF Micro-Nikkor \(200~\mathrm {mm}\) f/4D prime lens, resulting in a visualized field of \(100~\mathrm {mm}\times 100~\mathrm {mm}\) and a spatial resolution of \(20~\mathrm {pixels/mm}\). The laser pulses were separated by \(0.5~\mu {\rm s}\), and a maximum of 200 image pairs were acquired in all experiments. A synchronizer with an accuracy of \(0.25~\mathrm {ns}\) ensured that the laser and the camera operated simultaneously. Titanium dioxide (\({\text{TiO}}_{2}\)) particles with particle diameter \(200~\mathrm {nm}\) and relaxation time 0.41 μs were chosen for seeding.

A \(40^ \circ\) compression ramp model was used to form complex flow field structures, such as the flow separation and shock wave/boundary layer interaction, as shown in Fig. 8a. Figure 8b is the average velocity field calculated from 100 instantaneous velocity fields measured by commercial PIV software Insight 4G. The separation shock and the reattachment shock are represented by two white dotted lines, and the grey area indicates the compression ramp model. The hypersonic laminar flow has different stages such as boundary layer transition, flow separation and reattachment throughout the flow process. The shear layer forms and grows along the flow direction gradually, the shear layer surrounds the recirculation zone, and the free stream surrounds the shear layer. More details about the experimental design can be found in our previously published paper (Lu et al. 2019), and we omit that information here.

Fig. 9
figure 9

Instantaneous velocity fields and streamlines of \({40^ \circ }\) compression ramp flow at Mach 5 estimated by different methods: a result of multiple-pass cross-correlation; b result of H & S R\(+\)S estimation; c result of physics-based estimation; d result of FS-VOF estimation; e result of stochastic model estimation; f result of the proposed VD-VOF method

Fig. 10
figure 10

Spectrum analysis of the velocity fields for \({40^ \circ }\) compression ramp flow

The instantaneous velocity fields and streamlines measured by different methods are shown in Fig. 9. The flow structures of the hypersonic laminar flow over the \(40^ \circ\) compression ramp are successfully captured through the different fluid flow estimations. The velocity field structures estimated by different methods are basically the same. The trend of the streamlines clearly indicates the separation and reattachment of the flow. The shear layer gradually forms and grows along the flow direction, and the shear structure and shearing degree increase. The shear layer surrounds the recirculation zone, and the free stream velocity outside the shear layer is uniform. Due to the influence of the flow separation and shearing effect, the velocity direction is deflected and shows a tendency to coincide with the direction of compression of the flow channel.

The overall trend of the streamline reflects both the recirculation motion in the separation zone and the reattachment of the flow on the compression ramp. In the result of multiple-pass cross-correlation, as shown in Fig. 9a, the thickness of the shear layer is too large because of the interrogation window. The recirculation motion is incomplete in the velocity field measured by the H&S R\(+\)S and physics-based estimations, as shown in Fig. 9b and c, respectively. The separation shock and reattachment shock are not smooth in the result of stochastic model estimation, and the recirculation zone structure is compressed in the result of FS-VOF estimation. In comparison, the instantaneous velocity field measured by the proposed VD-VOF method is closer to the average velocity field in Fig. 8b. Compared with other instantaneous velocity fields, the structures of the recirculation zone and shear layer in Fig. 9f is more complete, and the boundaries of the separation shock and reattachment shock are smoother. The non-quadratic penalty function and bilateral filter kernel function in the proposed method ensure that the shock position obtained by this method is consistent with that obtained by FS-VOF estimation. Similar to the synthetic data discussed in Sect. 4.2, spectrum analysis is performed for the six processing methods and are shown in Fig. 10. The spectrum obtained by the proposed VD-VOF method retains the inertial scales before reaching the energy dissipating range and is closer to the \(-5/3\) spectrum slope. From this experiment, we can conclude that the proposed VD-VOF method is very well adapted to the estimation of fluid flows with a compressible flow structure.

6 Conclusion

In this study, we propose a novel optical flow formulation by considering both particle image information and physics theory of fluid flow. According to the Helmholtz velocity decomposition theorem, the proposed optical flow method decomposes the two-dimensional velocity field into four components: translation motion, linear distortion motion, shear distortion motion and rotation motion. In this context, regularization terms for different motion components are designed, which have a reasonable physical interpretation for the flow characteristics of the fluid. Subsequently, we design specific regularization parameters for the corresponding regularization terms according to the flow characteristics of the motion components. These regularization parameters can be adaptively adjusted with changes in the image space and velocity field. In addition, the data term of the optical flow formulation is based on the projected-motion equation derived from the continuity equation, which protects the compressibility of the fluid in the two-dimensional plane. A bilateral filter kernel function is used to suppress image noise and illumination changes in the experiment.

The proposed VD-VOF method is based on the continuity equation and Helmholtz decomposition theorem, considering both particle image information and physics theory of fluid flow. It is suitable not only for turbulent or incompressible flow but also for other flow conditions. To fully analyse the performance of the VD-VOF method, we analyse the comprehensive comparison results on synthetic and experimental image sequences using advanced cross-correlation and various optical flow approaches. For particle image data of analytic flows, the proposed VD-VOF method provides better results than previous advanced optical flow methods. For the 2D DNS turbulent flow particle image sequence, we present the effectiveness of our method for turbulent flow fields, and it is shown that the proposed velocity decomposition formulation outperforms some of the high-accuracy methods in the literature. Finally, we capture a compression ramp flow at a Mach 5 hypersonic flow field, and we demonstrate the good performance of the proposed VD-VOF method for a hypersonic compressible flow.