1 Introduction

Microscale particle tracking velocimetry (μPTV) is ubiquitous in flow measurements for micro-fluidic systems. To resolve the particle positions and track the 3-dimensional 3-component (3D3C) motion, multi-camera systems with volumetric reconstruction, and single-camera systems with rotating pinhole scanning or astigmatic lenses, have both been developed (Chen et al. 2009; Cierpka et al. 2010; Goesch et al. 2000; Ismagilov et al. 2000; Kumar et al. 2011; Yoon and Kim 2006). However, these methods are difficult to implement and typically require a complicated lens alignment or calibration procedure. A review of these techniques can be found in the paper by Cierpka and Kähler (2012).

On the contrary, single-camera defocusing PTV receives less attention in the micro-fluids community despite its simpler implementation, partially due to its limitation of low seeding densities and large out-of-plane (z) measurement uncertainties. Pioneering works in this field include an approach with deconvolution microscopy (Park and Kihm 2006) where the out-of-plane particle positions are obtained from their diffraction fringe radius, and this method has been demonstrated by measuring the 3D Brownian motion of suspended nanoparticles (Park et al. 2005). In recent years, Winer et al. (2014) proposed a calibration-based method that tracks cell-sized particles in microscale flows. This method was only demonstrated at a seeding density of about 20 particles/image, and the calibration procedure introduced a human-factor particle position uncertainty (about 2 μm) in the out-of-plane direction. Barnkob et al. (2015) developed a method based on cross-correlation between experimental images and a calibration image set with known out-of-plane positions. This method was demonstrated with distorted particles and arbitrarily-shaped cells. The estimated mean errors for out-of-plane particle position (z) and out-of-plane displacement measurement (w) were on the order of 1.9–4 μm and 1–2 μm, respectively. Fuchs et al. (2016) reported a technique using experimental images for in situ calibration of the out-of-plane position based on the particle image diameter, where the rms error of the out-of-plane displacement measurement (w) was estimated to be 9 μm. This approach can only be applied to thin domains with flow confined within the imaging plane. However, this is not the case for micro-fluidic channels with complex geometry, where all three dimensions are on the same order of magnitude and flow is 3-dimensional. Chen et al. (2017) used a tunable acoustic gradient index (TAG) lens to obtain over-sampled 2D defocused particle images, and 3D PTV measurement was demonstrated in a T-junction at low seeding density. The out-of-plane particle positions were determined by image sharpness estimation. While the 50-μm-uncertainty of the particle position could be improved by reducing the finite scanning step size, their algorithm does not allow sub-step-size position refinement. All aforementioned approaches suffer from either a low achievable seeding density, or a large out-of-plane measurement uncertainty/error, as summarized in Table 1.

Table 1 Details of recent defocusing PTV works for micro-fluidics

In this paper, we developed a novel experimental method for tracking particles in micro-fluidic channels with complex geometry where the flow is highly three-dimensional. This method is based on a new particle defocusing model, which captures both the out-of-plane and in-plane particle behaviors in an intensity volume. The intensity volume is formed by stacking 2D images captured using a nano-positioning piezo stage. Micron-sized particles are iteratively recovered and removed from the intensity volume by Hessian-based object identification, which suppresses non-particle structures and speeds up the segmentation. A least-square fitting of the particle model directly gives the 3D particle position with sub-voxel resolution, and consequently an additional particle diameter/intensity calibration, which is commonly required by other defocusing PTV methods, is no longer necessary. Unlike traditional defocusing PTV where particles are matched solely based on vicinity, velocity measurements in this paper are obtained by multi-parametric PTV algorithm (Cardwell et al. 2011), which uses all fitting parameters including particle positions to draw correspondence between frames. The information of local coherence of particle motion (Fuchs et al. 2017) is also taken into consideration in the particle matching process. Traditional defocusing PTV papers usually use a 2D simple Poiseuille flow with zero out-of-plane fluid motion for error analysis, which prevents the performance evaluation of the out-of-plane velocity component, and contradicts the purpose of 3D flow measurement. In this paper we utilize a highly 3D flow through porous media for a full error analysis and evaluation of algorithm performance over seeding densities at least 10 times higher than the current state-of-the-art defocusing PTV works. The proposed method has the advantage of easy implementation, and high accuracy in the out-of-plane direction.

2 Experimental method

2.1 Particle defocusing model

The original model describing the defocusing particle intensity behavior was proposed by Olsen and Adrian (2000). The model assumes a 2D Gaussian distribution for in-plane particle image brightness, and the integrated intensity over the particle image to be invariant when imaging at different out-of-plane positions. This model has been used by previous researchers to determine particle out-of-plane locations (Nguyen et al. 2012). After re-grouping terms, we re-write the particle intensity model in Cartesian coordinates as in Eq. (1),

$$\begin{aligned} I(x,y,z) & = k_{1} + I_{\text{peak}} \left( z \right)I_{{{\text{in}} - {\text{plane}}}} \left( {x,y} \right) \\ & = k_{1} + \left( {k_{2} + k_{3} e^{{ - \frac{{\left( {z - k_{8} } \right)^{2} }}{{2k_{4}^{2} }}}} } \right)e^{{ - \frac{{\left( {x - k_{6} } \right)^{2} + \left( {y - k_{7} } \right)^{2} }}{{2\left( {k_{5} /4} \right)^{2} }}}} , \\ \end{aligned}$$
(1)

where (x, y, z) represents voxel coordinates in the intensity volume with z as the out-of-plane direction. Iin-plane is the in-plane particle intensity distribution, and Ipeak is the particle peak intensity in different imaging planes, which can be approximated as 1D Gaussian (Adrian and Yao 1985). Parameters from k1 to k8 fully capture the particle behavior in the imaging volume, and their physical meanings are shown in Table 2. For current study, those parameters are particle-specific and determined from model fitting for each experimental particle individually from the intensity volume. Therefore, they can be used to distinguish particles and draw correspondence between frames in PTV in this study.

Table 2 Defocusing intensity model parameters

To demonstrate that this model describes the defocusing behavior of real particles, 1-μm fluorescent particles were embedded in a polydimethylsiloxane (PDMS) target, and the intensity volume was recorded using the experimental setup described in later sections, with a step size in the out-of-plane direction (z) of 0.1 μm. Figure 1a–c shows an example particle from the volume. At each z, the in-plane diameter and peak intensity were determined by least-square fitting to Iin-plane(x, y), and the peak-intensity profile was then fitted to Ipeak(z). To obtain the averaged profile in Fig. 1d, the peak-intensity profiles of 1098 experimental particles were fitted individually to Ipeak(z). For each profile, the out-of-plane position was standardized by (z − z0)/σ with z0 = k8 and σ = k4 from each fitting, and the peak intensity of each plane was normalized by Imax = I(x0, y0, z0) = k1 + k2 + k3. Finally, the standardized profiles were overlaid, and at each (z − z0)/σ position the mean and standard deviation of the normalized intensities were calculated and plotted. The intensity profiles of over 1000 particles collapse after standardization by parameters from the proposed model, as indicated by the narrow standard deviation band, and this confirms that the model is able to capture the behaviors of the particles to be used in the flow measurement.

Fig. 1
figure 1

Example of micron-sized defocusing particles. a Particle in-plane diameter as a function of z, b particle shown with diameter and peak intensity for each plane, c particle peak intensity at different z planes, d averaged intensity profile from 1098 experimental particles after model fitting and standardization

2.2 Overview of processing algorithm

The data processing algorithm is illustrated in Fig. 2. For each intensity volume formed by stacking 2D microscopic images, a Hessian filter identifies bright tubular structures as particle cores. Then a connected-component analysis starting from identified cores segments the volume by erosion–dilation dynamic thresholding (Cardwell et al. 2011). Least square fitting (LSF) of each segmented region to the defocusing model gives parameters for particle intensity removal and later particle tracking. Model-fitted intensities of reconstructed particles then are removed from the volume. The particle reconstruction is done iteratively until all desirable particles are recovered. Finally, reconstructed particles are fed into our in-house 3D hybrid PIV-PTV algorithm for flow measurement.

Fig. 2
figure 2

Flow chart for the data processing algorithm

The detailed algorithms for particle reconstruction and tracking will be elaborated in the following sections, with summaries of performance evaluation by numerical experiments using artificial images. The details of the numerical experiments and a full error analysis are documented in Sect. 2 in the supplementary materials.

2.3 Particle reconstruction method

2.3.1 Particle segmentation and model fitting

Object detection by Hessian matrix is ubiquitous in image processing (Hsu et al. 2017; Klette 2014; Lakemond et al. 2012; Leibe et al. 2008; Liu et al. 2010; Niemeijer et al. 2005), which speeds up segmentation by suppressing false intensity peaks. For each voxel with intensity I(x, y, z), the Hessian matrix is composed by second order central differences as in Eq. (2),

$$H\left( {x,y,z} \right) = \left[ {\begin{array}{*{20}c} {\frac{{\partial^{2} I}}{{\partial x^{2} }}} & {\frac{{\partial^{2} I}}{\partial x\partial y}} & {\frac{{\partial^{2} I}}{\partial x\partial z}} \\ {\frac{{\partial^{2} I}}{\partial y\partial x}} & {\frac{{\partial^{2} I}}{{\partial y^{2} }}} & {\frac{{\partial^{2} I}}{\partial y\partial z}} \\ {\frac{{\partial^{2} I}}{\partial z\partial x}} & {\frac{{\partial^{2} I}}{\partial z\partial y}} & {\frac{{\partial^{2} I}}{{\partial z^{2} }}} \\ \end{array} } \right]$$
(2)

Structures of interest such as sheets, blobs, and tubes can be identified by the eigenvalues and eigenvectors of H(x, y, z) describing the principle directions of intensity change. When sorted in ascending order, the eigenvalues (|λ1| ≤ |λ2| ≤ |λ3|) and corresponding structures are shown in Table 3, and stacked defocusing particle images contain a core region that resembles a bright tube.

Table 3 Eigenvalues and corresponding structures

The voxels in the intensity volume with one small eigenvalue (0.2 |λ|max) and two large negative eigenvalues (− 0.4 |λ|max) are labeled as particle cores (yellow contours in Fig. 3a, b). The segmentation is performed by first identifying all peak-intensity voxels among particle cores via dynamic erosion process. Then two separate dilation procedures are performed starting from identified peak-intensity voxels using the 26-neighborhood connectivity as follows: (a) Grouping only core voxels (yellow contours in Fig. 3c). The intensity weighted centroid (IWC) and the span of this region serve as the initial values and the limits in least square fitting (LSF) procedure for (k6, k7, k8). (b) Grouping all bright voxels from original volume that belong to this particle, ensuring the maximum amount of information is available for LSF. The particle centroid (k6, k7, k8) with sub-voxel resolution is obtained by the LSF to the particle model in Eq. (1), together with other five parameters (k1,2,3,4,5) that fully characterize the particles. In practice, the performance of the LSF depends heavily on the boundaries of parameter values, the maximum iteration limit, the advancing step sizes, the termination criterion, etc. For a specific type of particle, tunings of those options are recommended via some pilot testing before actual experiments. Figure 3 shows the segmentation and model fitting of one artificial particle.

Fig. 3
figure 3

Particle segmentation and model fitting. Top view is the central xy plane, while side view is the central xz plane. a, b Eigenmaps of the Hessian matrix for λ2 and λ3. c Intensity volume and the identified core region. d Results of model fitting along the centerlines

2.3.2 Particle intensity removal

Due to oversampling, each particle appears in multiple image planes. This leads to an increased probability of particle overlapping compared with a regular PTV/PIV volume. To recover more overlapping particles, the reconstruction operates iteratively as described in Fig. 2. In each iteration, only the “particles” whose intensities can be well represented by the defocusing model are added to the list of successfully reconstructed particles, and the model-fitted intensities are subtracted at each voxel. The degree of how well the intensities are described by the model is quantified by coefficients of determination (R2). The R2 threshold depends on the experimental setup and image quality, and is set to 0.90 for this study based on visual inspection. A lower threshold recovers more particles, but risks allowing less ideal flow tracers, like particle clusters or non-particle impurities, to enter the particle tracking process and results in erroneous flow measurements.

The intensity removing procedure and the improvement of position estimation are demonstrated by the twin artificial particles in Fig. 4. The right particle is first recovered and removed from the volume, which leaves the left particle in an isolated environment. When the intensity values from the neighboring particle are removed, the position estimation errors of the left particle are reduced from 0.06 voxel to 0.01 voxel in x direction, and from 0.02 voxel to 0.00 voxel in z direction. In general, when a particle is farther away from other particles, the model fitting results in a higher R2 value with a lower position error.

Fig. 4
figure 4

Example of removing particle intensity. a Side view (central xz plane) of the volume. b, c Centerline fitting results of the left particle in x and z direction, respectively

2.3.3 Performance evaluation of particle reconstruction

To evaluate the performance of the particle reconstruction algorithm, numerical experiments were performed using artificial images at 9 seeding densities (cppv) from 1e−4 to 1.6e−3 particles per voxel (ppv), or equivalently cppp from 2e−3 to 3.2e−2 particles per pixel (ppp), since each particle appears in about 20 image planes across the out-of-plane direction. The artificial images of particles that follow the Olsen and Adrian (2000) defocusing model were generated by our in-house MATLAB code, and then were analyzed by several particle reconstruction algorithms with two of them presented in Table 4: (1) FT-IWC, simple segmentation by fixed-intensity-value threshold (FT), with particle position estimation by intensity weighted centroid (IWC); (2) HeDT-LSF-IPR, the proposed segmentation by Hessian-aided dynamic thresholding (HeDT), with position estimation by least square fitting (LSF) of particle model, and an iterative particle removal (IPR) scheme. Performance measures include particle yield rates (η), mean (emean) and R.M.S. (erms) of particle position errors as

$$\begin{aligned} \eta & = \frac{{N_{\text{rec}} }}{{N_{\text{gen}} }} \\ e_{{i,{\text{rec}}}} & = \sqrt {(x_{{i,{\text{rec}}}} - x_{{i,{\text{gen}}}} )^{2} + (y_{{i,{\text{rec}}}} - y_{{i,{\text{gen}}}} )^{2} + (z_{{i,{\text{rec}}}} - z_{{i,{\text{gen}}}} )^{2} } \\ e_{\text{mean}} & = \frac{1}{{N_{\text{rec}} }}\sum\limits_{i = 1}^{{N_{\text{rec}} }} {e_{{i,{\text{rec}}}} } \\ e_{\text{rms}} & = \sqrt {\frac{1}{{N_{\text{rec}} }}\sum\limits_{i = 1}^{{N_{\text{rec}} }} {\left( {e_{{i,{\text{rec}}}} - e_{\text{mean}} } \right)^{2} } } , \\ \end{aligned}$$
(3)

where Ngen and Nrec represent the numbers of particles generated in and reconstructed from the intensity volume, respectively. And for each reconstructed particle (x, y, z)i,rec, the corresponding true position is (x, y, z)i,gen. A detailed error analysis could be found in Sect. 2.4 in the supplementary materials.

Table 4 Summary of performance improvement

For position estimation errors, emean and erms of FT-IWC are consistently higher than our proposed method for all seeding densities. With Hessian filtering and model fitting, our algorithm rejects “particles” that overlap too much when there is no bright tubular structure, or when R2 falls below the threshold. As a result, our method reduces emean by 91% at c = 1e−4 ppv, and 67% at c = 1.6e−3 ppv. The erms reduction is not as significant, but our method still delivers a more robust position estimation. As for particle yield rates, the FT-IWC method recovers about 70–80% of the particles in the volume regardless of seeding densities. Our method recovers 22% more particles than FT-IWC at c = 1e−4 ppv. For higher seeding densities, overlapping particles form intensity clumps, inside which the position of each particle cannot be determined accurately. When cppv goes beyond 1.6e−3, our method is likely to fail in keeping errors below 0.5 voxel, and the improvement of particle yield rate is not as rewarding. This indicates seeding densities above 1.6e−3 ppv should be avoided in real experiments.

2.4 Particle tracking algorithm

As described in Fig. 2, the flow measurement is achieved by a hybrid PIV/PTV algorithm. PIV predictors are obtained by two passes of robust phase correlation (RPC) (Eckstein et al. 2008; Eckstein and Vlachos 2009) with 75%-overlapping interrogation windows of 64 × 64 × 64 voxels and 32 × 32 × 32 voxels, respectively. Depending on the PTV algorithm, the PIV velocity field is used either to predict particle positions in the second frame, or to indicate the search radius for displacement histogram construction, as further elaborated below.

2.4.1 Generalized multi-parametric PTV

The idea of multi-parametric PTV utilizes particle properties or features besides their locations to draw correspondence of particles between frames. In the original MP3-PTV method (Cardwell et al. 2011), only the diameter and intensity of each particle are used for tracking. For current study, we expand the MP3-PTV to arbitrary number of tracking parameters, as long as those parameters help distinguish particles. We introduce a new generalized particle with spatial coordinates (x, y, z), which vary as a function of time, and a list of properties (P1,2,3,…,M), which only change slightly over frames. These properties could be diameter, peak intensity, or size, aspect ratio, and fluorescence color. The tracking is then performed in the (M + 1)-dimensional particle feature space. We utilize the relatively stable properties (P1,2,3,…,M), together with spatial information from (x, y, z), to find the most probable matching between particles. Among all possible matching particles j with (xj, yj, zj) in the second volume, the pairing particle k is chosen as the one with the minimum weighted deviation from particle i in the first volume by Eq. (4).

$$k = \mathop {\arg \hbox{min} }\limits_{j \in S} \left( {\frac{{\frac{{\sqrt {\left( {x_{j} - x_{i}^{\prime } } \right)^{2} + \left( {y_{j} - y_{i}^{\prime } } \right)^{2} + \left( {z_{j} - z_{i}^{\prime } } \right)^{2} } }}{{R_{\text{search}} }} \times w_{xyz} { + }\sum\nolimits_{m = 1}^{M} {\frac{{\left| {P_{m,j} - P_{m,i} } \right|}}{{\left| {P_{m,{\max} } - P_{m, {\min} } } \right|}} \times w_{m} } }}{{w_{xyz} { + }\sum\nolimits_{m = 1}^{M} {w_{m} } }}} \right),$$
(4)

where S is a searching neighborhood within a user-defined radius (Rsearch) around the PIV-predicted position \((x_{i}^{\prime } ,y_{i}^{\prime } ,z_{i}^{\prime } )\) in the second frame of particle i, and wwyz and wm are the associated weights.

2.4.2 Coherent multi-parametric PTV

The legacy usage of the nearest neighbor term (\(\sqrt {\left( {x_{j} - x_{i}^{\prime } } \right)^{2} + \left( {y_{j} - y_{i}^{\prime } } \right)^{2} + \left( {z_{j} - z_{i}^{\prime } } \right)^{2} }\)) in Eq. (4) usually leads to erroneous measurement. The right pairing is not necessarily the matching between closest particles, but should yield a displacement that follows the flow trend coherently in its neighborhood. Inspired by the tracking approach proposed by Fuchs et al. (2017), here we define a coherence deviation as in Eq. (5),

$$P_{{{\text{co}},i - j}} = \sqrt {\left[ {\left( {x_{j} - x_{i} } \right) - \Delta \bar{x}_{i} } \right]^{2} + \left[ {\left( {y_{j} - y_{i} } \right) - \Delta \bar{y}_{i} } \right]^{2} + \left[ {\left( {z_{j} - z_{i} } \right) - \Delta \bar{z}_{i} } \right]^{2} } ,$$
(5)

for all possible pairs (ij) between two frames. Here (Δi, Δi, Δi) indicates the most probable displacement in a neighborhood (S) centered at particle (xi, yi, zi) in the first frame. Within S, all particles in the first frame have possible matchings to all particles in the second frame, and displacement histograms for (Δx, Δy, Δz) are constructed using those possible matchings. The most probable displacement (Δi, Δi, Δi) is obtained as the displacement corresponding to the histogram peaks, as explained in detail in Fuchs et al (2017).

In this study, PIV predictors are used to guide the histogram construction. For example, given a particle (xi, yi, zi) in the first frame, only matchings that yield displacements with each component less than 5 voxels off the interpolated PIV displacement at (xi, yi, zi) are considered in the histogram construction. Finally, the coherence deviation replaces the nearest neighbor term in Eq. (4) as the information from spatial coordinates (x, y, z), then we come to the final form of Eq. (6),

$$k = \mathop {\arg \hbox{min} }\limits_{j \in S} \left( {\frac{{\frac{{P_{{{\text{co}},j}} }}{{\left| {P_{{{\text{co}},max}} - P_{{{\text{co}},min}} } \right|}} \times w_{\text{co}} { + }\sum\nolimits_{m = 1}^{M} {\frac{{\left| {P_{m,j} - P_{m,i} } \right|}}{{\left| {P_{m, {\max} } - P_{m, {\min} } } \right|}} \times w_{m} } }}{{w_{\text{co}} { + }\sum\nolimits_{m = 1}^{M} {w_{m} } }}} \right),$$
(6)

where for this study, the model fitting parameters k1,2,3,…8 are taken as particles properties P1,2,3,…8. The sensitivity analysis of the weights (wco, w1,2,3…,8) associated with each tracking parameter is not included in this study, and the weights are set to be equal for simplicity.

2.4.3 Performance evaluation of tracking algorithms

Numerical experiments using artificial images were performed to evaluate the performance of the particle tracking algorithms. The Hagen–Poiseuille flow through a rectangular duct was chosen by previous researchers (Barnkob et al. 2015; Winer et al. 2014) to quantify defocusing PTV measurement error due to its simplicity. However, the out-of-plane velocity component of Hagen–Poiseuille flow is zero, which limits the corresponding error evaluation. In current study, the benchmark field used to synthesize artificial images was generated by direct numerical simulation (DNS) of flow through randomly-packed beads of diameter D (Aramideh et al. 2018), as summarized in Fig. 5. This flow field is highly 3-dimensional with a large dynamic range as shown in the probability density functions (PDFs) of velocity magnitude and orientation. Performance measures include standard track yield rates (EY), track reliability (ER), mean (emean) and R.M.S. (erms) of velocity measurement errors. See details of the artificial image generation and full error analysis in Sect. 2.5 in the supplementary materials. Please note that the random motion of particles due to Brownian effect was not simulated in the numerical experiments, and consequently the associated bias error is not captured in the performance measures for all PTV methods evaluated.

Fig. 5
figure 5

The benchmark flow field used to evaluate PTV performance. a The velocity magnitude PDF, b the velocity orientation PDFs, c the 3D rendering of packed beads, and d a cross-sectional view of the mid-plane

Performance of particle matching The total number of particle pairs generated in the original volume is NV. And Nv represents the number of particle pairs remaining in the volume after particle reconstruction. The ratio of those two

$$E_{\text{v}} = \frac{{N_{\text{v}} }}{{N_{\text{V}} }}$$
(7)

quantifies the particle reconstruction efficiency, and sets the upper limit of tracking yield rate, which is defined as

$$E_{\text{Y}} = \frac{{N_{\text{D}} }}{{N_{\text{V}} }}$$
(8)

where ND is the number of tracks yielded from particle tracking without validation. The tracking reliability is evaluated by checking if each track represents one of the actual particle pairs in the original volume,

$$E_{\text{R}} = \frac{{N_{\text{N}} }}{{N_{\text{D}} }}$$
(9)

where NN is the number of validated tracks, and this quantifies to what degree yielded vectors from a tracking method can be trusted.

Performance of flow measurement The measurement error of each track (u, v, w)i was quantified by comparison with the spline-interpolated DNS velocities (u, v, w)i,DNS at measurement position (x, y, z)i by

$$e_{i} = \sqrt {\left( {u_{i} - u_{{i,{\text{DNS}}}} } \right)^{2} + \left( {v_{i} - v_{{i,{\text{DNS}}}} } \right)^{2} + \left( {w_{i} - w_{{i,{\text{DNS}}}} } \right)^{2} }$$
(10)

where the measurement position was the track mid-point. Low-velocity measurement errors require both a high vector reliability and low particle position errors. Then the mean and R.M.S. errors were calculated over the entire domain by

$$\begin{aligned} e_{\text{mean}} & = \frac{1}{{N_{\text{D}} }}\sum\limits_{i = 1}^{{N_{\text{D}} }} {e_{i} } \\ e_{\text{rms}} & { = }\sqrt {\frac{1}{{N_{\text{D}} }}\sum\limits_{i = 1}^{{N_{\text{D}} }} {\left( {e_{i} - e_{\text{mean}} } \right)^{2} } } \\ \end{aligned}$$
(11)

Overall PTV performance A new performance measure as defined in Eq. (12), is introduced to capture the overall performance:

$$\varepsilon = E_{\text{overall}} \times \left( {1 - e_{{{\text{total}},\% }} } \right),$$
(12)

where Eoverall captures the overall matching performance, and etotal,% is the total percentage error with respect to the maximum velocity magnitude (umax) in the field as defined in Eq. (13),

$$\left\{ {\begin{array}{*{20}l} {E_{\text{Overall}} = E_{\text{Y}} \times E_{\text{R}} } \hfill \\ {e_{{{\text{total}},\% }} = \frac{{\sqrt {e_{\text{mean}}^{2} + e_{\text{rms}}^{2} } }}{{u_{\text{max} } }} \times 100\% } \hfill \\ \end{array} } \right.$$
(13)

Summary of performance improvements The performance of the PIV predictor, together with two PTV algorithms at two extreme seeding densities (1e−4 and 1.6e−3 ppv or equivalently 2e−3 and 3.2e−2 ppp) are presented in Table 5: (1) NN, a classical nearest neighbor tracking of FT-IWC particles (Barnkob et al. 2015; Fuchs et al. 2016; Winer et al. 2014), using PIV predictors and a fixed search radius (5% of D) as a baseline; (2) CoMp, our proposed coherent multi-parametric method tracking HeDT-LSF-IPR particles with a PIV-aided histogram construction.

Table 5 Summary of performance improvements

In terms of tracking performance, at cppv = 1e−4 our proposed method shows improvement of EY by about 90% over the NN method, thanks to the ability of recovering more particles by HeDT-LSF-IPR. And at cppv = 1.6e−3, our method shows improvement of ER by 12% over the NN method, since the particles are better distinguished with more tracking parameters. As for velocity measurement, the reduction of both emean and erms is 95%, 74%, respectively at cppv = 1e−4, and 80%, 49%, respectively, at cppv = 1.6e−3, when compared with NN method. As a conclusion, our proposed method delivers more reliable measurements with lower errors when compared with PIV predictor and nearest neighbor tracking, as captured by the highest value of ε. Note that the introduced measurement ε is bounded in [0,1], where 1 corresponds to the best performance possible.

3 Experimental demonstration: flow through a glass bead channel

3.1 Experimental setup

A schematic drawing of the experimental setup is shown in Fig. 6a. A micro-fluidic channel is mounted on a 100-μm-range piezo stage (Nano-Z100-N, Mad City Labs Inc.). Integrated with an inverted microscope (Eclipse Ti-E, Nikon Instruments Inc.), the piezo stage position control and the camera synchronization are realized via a DAQ board (USB-6363, National Instruments) with Data Acquisition Toolbox (MATLAB, The MathWorks Inc.). For recording each volume, the stage moves in a step-wise manner from z = 0 μm to 100 μm to volumetrically scan the flow field at a maximum out-of-plane speed of 1 μm/μs, as illustrated in Fig. 6b (five steps shown for simplicity). This scanning speed should be determined according to the scanning depth and recording time by uscan = (zmax − zmin)/Trec. The recording time (Trec) should be adjusted by performing pilot testing before actual experiments, to restrict the maximum inter-plane particle displacements within the same volume to less than 1 voxel. If the particle intensities in the recorded volume seem skewed towards the flow direction, Trec need to be reduced such that with sufficiently high uscan, the particles are ‘frozen’ in their places while the instantaneous scans are being recorded by the camera. On the other hand, the idle time (Tidl) should allow the flow to develop before capturing next volume, and the ideal inter-volume particle displacements is about 10 voxels. At each z step, the camera is triggered once to capture one image. After the entire volume is recorded, the stage returns to z = 0 μm. The stage has an internal position sensor with sub-nanometer resolution that sends a feedback signal, which is recorded to ensure the images are captured at desired elevations. For a step size (Δz) of 1 μm, the repeatability of the stage is experimentally estimated to be on the order of 30 nm (or 3% of Δz, see Sect. 1.1 in the supplementary materials for details), which ensures low uncertainty of the particle z positions without calibration.

Fig. 6
figure 6

a Schematic drawing of the experimental setup. b Camera-stage synchronization and data recording (five steps shown for simplicity)

To demonstrate flow measurement in micro-fluidics with complex geometry, a flow channel was fabricated using rectangular borosilicate glass tube (LRT-060-6-40, F&D Glass) with inner dimensions 50 mm × 6 mm × 0.6 mm (length × width × depth). This channel was fully packed with 200-μm-diameter borosilicate glass beads (BSGMS-2.2 180-212um, Cospheric LLC), which gave 3–4 layers of beads across channel depth. To eliminate trapped air in unconnected pores, empty glass tube was first saturated with working fluid, and then glass beads were deposited freely into the tube. The channel was then assembled with 3D-printed flow inlet/outlet and sealed by epoxy-binding agents. From scans obtained by a μCT microscope (Zeiss Xradia 510), the porosity (void fraction) was estimated by Otsu’s binarization (Otsu 1979) to be around 0.34, which is close to the maximally random jammed (MRJ) monodispersed sphere packings (Klatt and Torquato 2016) where the mean pore size is around 0.063 bead diameter, or 12.6 μm for current study.

The reservoir was open to atmosphere, and the flow was generated by a syringe pump (PHD ULTRA, Harvard Apparatus) at a volumetric flow rate of 1.0 μL/min, which resulted in an estimated Reynolds number of 0.0015 based on bead diameter, or 0.0001 based on the mean pore size. The working fluid was a mixture of distilled water (7% weight) and dimethyl sulfoxide (W387520, Sigma-Aldrich), which matched the refractive index (nD) of the glass beads at nD = 1.468. The tracer particles were 1 μm carboxylate-modified Nilered fluorescent particles (excitation/emission maxima at 535/575 nm, FluoSpheres F8819, Invitrogen) and were excited by a green continuous LED light source (550/15 nm, 260 mW, SPECTRA X Light Engine, Lumencor Inc.). The particle-emitted light went through a 10 × objective lens (CFI Plan Fluor, Nikon Instruments Inc., NA = 0.3, W.D. = 16 mm) and a polychroic and a CFP/YFP/M-Cherry bandpass filter cubes (440/30 nm, 510/10 nm, 575/25 nm, Lumencor Inc.), then was captured by a CMOS camera (Phantom Miro M340, Vision Research, 10 μm pixel size). The combined magnification ratio (Mxy) was 1 μm/pixel, and the depth-of-focus was estimated to be around 6.72 μm. Fifty 100-image stacks (Δz = 1 μm) were captured with a temporal resolution of 1 s between volumes. The image size was 1000 × 1000 pixels, resulting in a measurement domain of 1000 × 1000 × 100 μm3 near the channel center. For each voxel (x, y, z)img in the imaged volume, corresponding world coordinates (X, Y, Z)obj is obtained via simple relationships in Eq. (14),

$$\left\{ {\begin{array}{*{20}l} {(X - X_{0} ,Y - Y_{0} )_{\text{obj}} = M_{xy} \times (x - x_{0} ,y - y_{0} )_{\text{img}} } \hfill \\ {\left( {Z - Z_{0} } \right)_{\text{obj}} = \Delta z \times \left( {z - z_{0} } \right)_{\text{img}} ,} \hfill \\ \end{array} } \right.$$
(14)

where (X0, Y0, Z0)obj and (x0, y0, z0)img correspond to the same reference point in the channel, and this correspondence needs to be calibrated prior to the experiment by adjusting the dial for stage vertical offset level on the microscope, and bringing the reference point well into focus. The reference point could be a feature structure of measurement interest, e.g., the top/bottom of the channel, the intersection of a Y junction, or the midpoint of a backward facing step. For current study, due to random packing this reference point was arbitrarily chosen as the surface of one glass bead.

See details of the refractive index matching, porosity estimation, stage repeatability estimation, and a detailed walk-through of the procedure for choosing Trec and Tidl in Sect. 1 of the supplementary materials. Flow measurements were obtained by three methods separately: (1) PIV, direct cross-correlation of intensity volumes, (2) PTV-NN, nearest neighbor tracking of FT-IWC particles, and (3) PTV-CoMp, our proposed method tracking HeDT-LSF-IPR particles. The measured fields were validated by local median filters.

3.2 Experimental result

A visualization of flow tracers going around glass beads in a 250 μm × 250 μm × 100 μm cropped region around the measurement domain center is shown in Fig. 7. This region consists of four contacting glass beads forming one pore body and four pore throats. The glass bead positions were estimated by overlaying raw 2D particle images of each imaging plane over time sequence, and the overlaid particle images of the z = 100 μm imaging plane is shown in Fig. 7a as an example. The bulk flow was along the positive X direction (from left to right). Out of total 1974 Lagrangian PTV tracks over 50 s, only 86 are shown for better visual presentation without few track overlappings in Fig. 7b. Each color represents a unique Lagrangian track, and the time lag between two adjacent points on the same track is 1 s. The 3D visualization of the beads and tracks is shown in Fig. 7c.

Fig. 7
figure 7

Visualization of PTV results of the center domain. a The overlaid particle images for the z = 100 μm plane over the entire time sequence. be PTV tracks going around four contacting spheres shown in the top view, the 3D view, and two side views

Furthermore, Fig. 7b shows that the particle tracks follow the bead curvature. And the closer the tracks to bead surfaces, the distance between the adjacent two points on the same track is shorter, indicating a lower flow velocity near the boundaries. The typical reasons for track termination include particle reconstruction failure due to image quality of some of the frames, and particles moving out of the 100 μm vertical scanning range (see tracks near the top plane with the tread of going “into” the cut-out part of the beads). This implies although the current flow channel has a large aspect ratio (width/height = 10) and there are only about 4 beads across channel height, the out-of-plane motion of the flow is not negligible.

To characterize the measured flow field and show comparison with baseline methods, the PDFs of velocity magnitude (Umag), azimuth angle (φ), and elevation angle (θ) over the entire measurement domain and time sequence are constructed and plotted in Fig. 8. The PDFs for PIV were constructed after masking out the measurements in the solid phase, based on overlaid particle images over the entire time sequence similar to Fig. 7a. The velocity magnitude is non-dimensionalized by the average velocity magnitude (Uavg), which is estimated from the measurement to be around 6.30 µm/s, or 6.30 voxels/frame. With an interrogation window of 64 × 64 × 64 voxels on the first pass for the PIV predictor, the maximum displacement that was captured was around 10 Uavg. However, since only a small portion of the flow channel was measured (half bead diameter in the out-of-plane direction), this Uavg should not be interpreted as the characteristic velocity of flow through porous media. The results of PTV-CoMp show qualitative agreements with previous studies (Aramideh et al. 2018; Datta et al. 2013; Matyka et al. 2016). The Umag PDF peak lies in the low range (Umag< Uavg), which implies that very low flow velocity occurs in most of the domain. The PDF decays in a similar manner as Fig. 5a, but only up to Umag/Uavg= 4. This might be due to the fact that higher velocities did not occur in the narrow scanning volume, or the estimated Uavg is higher than the actual characteristic velocity for the entire channel. The PDFs of PTV-NN and PIV follow the PTV-CoMp in the middle range but deviate for both small and large values of Umag/Uavg.

Fig. 8
figure 8

Normalized probability density functions (PDFs) of a velocity magnitude, b velocity azimuth angle, and c velocity elevation angle for PTV-CoMp, PTV-NN, and PIV measurements

As for velocity directions, both PDFs of PTV-CoMp have peaks located at 0 radians. This implies that the flow is mostly along positive X, which is the pump-exerted flow direction. Both PDFs decay and remain symmetric with respect to zero, in similar patterns as Fig. 5b. The fact that a small portion of the azimuth angle (φ) PDF lies outside the [− π/2, + π/2] range implies that a reversing flow occurs around the beads. This has been observed and reported by previous works (Aramideh et al. 2018; Datta et al. 2013; Matyka et al. 2016). The PDF of azimuth angle (φ) from PIV seems to deviate severely from the trend observed in both PTV-CoMp and DNS from Fig. 5(b), confirming that it is not suitable for flow measurement in complex geometries due to bias error near frequent solid–liquid interfaces. The PDFs for PTV-NN show approximately same trends as PTV-CoMp, but with more fluctuations when |φ| is larger than π/2. Among the three measurement methods, our proposed PTV-CoMp method shows the best capability of resolving the highly three-dimensional flow field over a large dynamic range in the glass bead channel.

4 Conclusion and discussion

A new 3D defocusing model was proposed which captures the particle behavior in intensity volumes formed by stacking 2D defocusing microscopy images. Micron-sized particles are reconstructed from the intensity volume by a Hessian-aided dynamic segmentation and least-square fittings to the proposed model. An iterative particle removal regime was implemented to accommodate high seeding density up to 1.6e−3 ppv (3.2e−2 ppp). The model fitting directly gives 3D particle positions and does not need a separate particle diameter/intensity calibration process in the out-of-plane direction, owning to high repeatability of the piezo stage. However, since the current particle model assumes depth-wise symmetric intensity profile with respect to particle location, the estimation of particle out-of-plane position is subject to bias error. Replacing the current defocusing model with one that faithfully captures the depth-wise asymmetry of the fluorescent particles could potentially lead to better flow measurement accuracy.

The model fitting also gives parameters that distinguish particles, and are used as tracking properties in hybrid PIV–PTV algorithm for flow measurement. The effect of parameter weights on tracking accuracy is not quantified in the current study. In practice the authors recommend heavier weights on the parameters with larger variance over all particles. However, for applications where the properties of the seeding particles are rather uniform with little variations and the background illumination is absolutely uniform, there will be no additional information available to distinguish them based on those parameters (k1 to k5). Those parameters could then potentially be obtained by a pilot testing, and tabulated for future usage.

By error analysis using artificial data set, the proposed method shows improvements over other defocusing particle tracking methods, in terms of achievable seeding density, particle position accuracy, and particle tracking performance. In the numerical experiments, the effect of stage scanning speed was not simulated in the data set, and the intensity volume was assumed to be recorded instantly. To have a similar performance of the data processing algorithm when applied to real experimental data set, the stage scanning speed needs to be sufficiently high such that the particles are ‘frozen’ in their places while the scans are being recorded by the camera. Another limitation is the bias error associated with Brownian effect, which is not accounted for in the numerical experiments. When applying the proposed method to sub-micron particles, magnitude of Brownian motion needs to be estimated and considered, which should affect the accuracy of the proposed method.

A proof-of-concept experiment of flow through porous media shows qualitative agreement with both numerical and experimental results in the literature. To provide a full quantitative comparison between experiment result and DNS result, flow measurement and simulation under the same flow condition and exact packing geometry are necessary. However, this is beyond the scope of the current methodology work, which necessitates future efforts dedicated to the investigation of the flow physics and transport phenomena at pore-scale.

The influence of the relative ratios between out-of-plane scanning step size, depth-of-focus (DOF), and particle diameter on measurement performance is not systematically investigated. However, for actual application the scanning step size and particle size selection need to be optimized according to the DOF based on the specific optical setup and application needs, such that: (1) within each xy-plane, size of in-focus particle images should be at least 3 pixels in diameter, similar to regular planer PIV/PTV applications (Brady et al. 2009); and (2) in the out-of-plane direction, there are at least five scans of one particle within the DOF to accurately determine the particle position in z.

In the proposed method, the piezo stage scanning speed (~ 1 volumes per second) is limited by the stage inertia and the precaution that the flow within the channel should not be affected by the stage scanning motion. Due to similar scanning procedure and data structure, by replacing our piezo stage with a piezo-actuated objective lens or an inertia-free axial-scanning tunable acoustic gradient index (TAG) lens (Chen et al. 2017; Shain et al. 2018), similar intensity volumes can be obtained. With the same data recording scheme, our particle recovery and tracking algorithms then can be directly applied for flow measurement at higher temporal resolution.