1 Introduction

In the study of granular flows, recent attention has centred on the collisional activity between particles. Generally, the low flow resistance of a granular flow is attributed to a reduction in the long-lasting frictional contacts between particles. The overburden pressure of the flow may instead by balanced by a collisional particle pressure [1], originally termed a dispersive pressure by Bagnold [2]. The granular temperature was originally termed by Ogawa [3] as an index of the collisionality of the flow, and corresponds to the average fluctuating component of the energy of a particle. For a field of particles with known velocity, the granular temperature is calculated by comparing each particle’s velocity to the group mean velocity, and averaging the square of these velocity fluctuations. Granular temperature was rapidly adopted as an input into kinetic theories [4,5,6]. However, the ability to accurately measure the granular temperature of physical flows has lagged behind the quantity’s adoption in constitutive models.

The most commonly applied methods to quantify granular temperature in published experimental results have involved automated image analysis of high-speed imagery, namely Particle Tracking Velocimetry (PTV) [7,8,9] and Particle Image Velocimetry (PIV) [10]. While the analyzed images are typically photographs taken through transparent flume side walls, Planar Laser Induced Fluorescence [11] and dynamic X-ray radiography [12] have been used to image inside flows. PTV requires video that clearly shows discrete particles, and as such is typically limited to monodisperse flows in laboratory settings. PTV involves determining the particle locations in each frame, and linking the particles between frames to generate displacement vectors (Fig. 1a). Alternatively, PIV consists of partitioning the initial image into search subsets (typically 8 to 64 pixels) and searching for the best matching location in the following image to generate displacement vectors. Either method returns a field of displacement vectors from which the granular temperature can be calculated. This is theoretically sound, but as this paper will discuss, small errors in image analysis can lead to large inaccuracies in measured granular temperature. Furthermore, without an accepted reference standard, there is no way to calibrate measurements.

Fig. 1
figure 1

A typical analysis workflow of side-on video of a monodisperse granular flow (a) using PTV identification of displacement vectors, which are averaged in horizontal bins to calculate (b) depthwise velocity profile. However, (c) identification of the particle centroid location, especially on a sub-pixel level, is often impercise. d Illustration of particle path from identified displacement vectors, demonstrating how errors at the sub-pixel level can result in false components of displacement vectors which would contribute to granular temperature

The calculation of granular temperature from a vector displacement field is a natural extension of the original use of image analysis for flows: i.e. the calculation of flow velocity. The velocity profile (Fig. 1b) is the most commonly referenced depth profile for a flow and can be calculated by averaging the velocity vectors of each of the particles in a region of the flow (‘ensemble average’). If the errors in particle position are distributed without bias, the ensemble averaging process will lead to an unbiased estimation of velocity profile. Gollin et al. [13] utilized PTV and PIV algorithms independently on high-speed video images of granular flows in a small laboratory flume and found both algorithms to similarly determine the velocity profile, independent of the image frame rate.

Recent advances in cameras with high temporal resolution and increased image resolution have fundamentally changed the input data available for image analysis. The high temporal resolution minimizes the particle displacement between frames, enabling a minimum displacement matching algorithm to be used rather than requiring more advanced filtering. The camera can be placed ‘closer’ to the flow (physically, or by means of a longer focal length lens). The higher image resolution means each particle is represented by more pixels (hereafter termed the ‘image diameter’). This can aid particle delineation as well as increase the texture available for PIV. For the purposes of determining the collisionality of the flow, the high temporal resolution also enables full tracking of the particle’s trajectory and minimizes the error due to undersampling [13, 14].

However, as this paper will discuss, some of the sources of error in measuring granular temperature are worse for faster camera frame rates or for particles represented by more pixels. Gollin et al. [13] demonstrated that the potential for mismeasurement of granular temperature can be much higher with PTV than PIV, and is dependent on the magnitude of particle displacement per frame, with lower displacements per frame leading to higher identified granular temperatures. This counterinuitively can lead to a reduction in the accuracy of granular temperature measurement as technology improves, unless the methods used are understood and assessed critically. The image remains represented by discrete pixels (Fig. 1c), hence, sub-pixel inaccuracies in the image analysis methods can lead to spurious components in the identified displacement vectors (Fig. 1d) and substantial errors within the calculated granular temperature. Rather than averaging out velocity fluctuations as with the calculation of the velocity profile, the calculation of granular temperature isolates and compounds the fluctuations. The apparent fluctuations may be real (due to collisional particle movement) or artifacts of the particle location identification process. Even a flow without any granular temperature can exhibit a ‘noise floor’, a minimum granular temperature that would be apparent from the identification process. Granular temperature measurements do not benefit from averaging in the same way that an a velocity measurements do, and thus even long duration measurements on a steady-state flow are not immune to this error.

Here, an error framework is presented to assess the influence of sub-pixel particle position errors on the determination of granular temperature. A review of PIV and PTV methods is presented, including a discussion on the general sources of error which are common to image correlation and sub-pixel estimation schemes. Subsequently, a first novel hybrid method (‘Guided-PIV’) is described where identified particle locations are utilized to initialize PIV tracking. Synthetic images are then analyzed to evaluate the noise floor of both Guided-PIV and PTV methods. Then, a second novel method is presented based on frequency based filtering of PTV results. Using this approach, we decompose a chain of particle movement into orthogonal vectors of velocity fluctuation, suitable for conversion into the frequency domain. The frequency spectra of the impulses can indicate if alternating compensatory errors are present. The possibility for frequency-based filtering is explored with a view to reducing the influence of image frame rate on granular temperature measurements. Finally, both novel methods are demonstrated on simulated images of a collisional flow generated in a Discrete Element Model.

2 Granular temperature from image analysis

The typical method for calculating granular temperature is performed on the displacement vectors between two image frames, as identified by PIV or PTV (Fig. 2a). When the displacement vectors are grouped into bins, each corresponding to a discrete partition of the flow height, the mean flow velocity can be found by averaging the results of each identified vector in the bin (Fig. 2b). This is done for each coordinate direction (u, v). The granular temperature for bin k can be calculated by first calculating the fluctuation components (Fig. 2c) in each coordinate of an orthogonal system: [13]

$$\begin{aligned} \left( u_{i}^{*}\right) _{k}=\left( u_{i}\right) _{k}-{\bar{u}}_{k} \end{aligned}$$
(1)
Fig. 2
figure 2

Calculation of granular temperature from (a) field of displacement vectors of individual particles, averaged within bins into (b) mean flow velocity depth profile. The mean flow velocity is subtracted from the individual vectors to calculate (c) the flucuating component of velocity. These velocity components are squared and averaged within the bins to quantify granular temperature

where * denotes the fluctuation component, i represents an individual vector and \({\bar{u}}_{k}\) the average flow velocity in the coordinate direction. The mean of the squares of this quantity is calculated for each bin k as follows by an ensemble average of the \(N_{k}\) particles in the bin:

$$\begin{aligned} \left\langle \left( u^{*}\right) ^{2}\right\rangle _{k}=\frac{\sum _{i=1}^{N_{k}}\left[ \left( u_{i}^{*}\right) ^{2}\right] _{k}}{N_{k}} \end{aligned}$$
(2)

The granular temperature is given as (units of velocity squared):

$$\begin{aligned} T_{k}=\frac{1}{2}\left\langle \left[ \left( u_{i}^{*}\right) ^{2}\right] _{k}+\left[ \left( v_{i}^{*}\right) ^{2}\right] _{k}\right\rangle \end{aligned}$$
(3)

In Eq. (3), the factor \(\frac{1}{2}\) is a scaling factor to account for the spatial dimension of the system [15]. When a three-dimensional system is observed through planar (two-dimensional) imagery, a \(\frac{1}{3}\) scaling factor is used when assuming the out-of-plane movement is zero. Alternatively, when assuming that out-of-plane movement is equal to bed-normal movement, the granular temperature is given as: [16, 17]

$$\begin{aligned} T_{k}=\frac{1}{3}\left\langle \left[ \left( u_{i}^{*}\right) ^{2}\right] _{k}+2\left[ \left( v_{i}^{*}\right) ^{2}\right] _{k}\right\rangle \end{aligned}$$

2.1 Effects of misidentification of particle movement

Figure 1d schematically illustrates a particle on a straight path (zero granular temperature), with the identified particle locations from successive frames indicated. Displacement vectors are then drawn between particle locations. If the particle locations deviate from the true path, the displacement vectors will have spurious components of movement, which would erroneously increase granular temperature. The effects of misidentification of particle movement can be assessed by propagating a particle velocity error term \(\overrightarrow{\varepsilon }\) through the expression for granular temperature. If \(\overrightarrow{\varepsilon }\) is zero-mean and uncorrelated with \(\overrightarrow{u}_{true}\), and the length of the vector has the average \(E\left( \left\| \overrightarrow{\varepsilon }\right\| \right) \equiv a\), the granular temperature can be shown to increase by \(a^{2}\).

Estimation of the average particle velocity error a can be made from an estimation of the particle positioning variance b (in physical units, not pixels) and the analyzed framerate \(f=\frac{1}{\Delta t}\). Through propagation of the positioning error in a two-point linear velocity equation, a characteristic velocity error term can then be taken as some multiple of \(f\sqrt{2b}\), leading to a granular temperature noise floor on the order of \(2f^{2}b\). As an example, a characteristic positioning error of \(\sigma \left( \varepsilon \right) =\sqrt{b}= 0.1 \,{px}\) (pixels), for images analyzed at 1000 fps with PTV and a 3 px / mm scale factor would result in a granular temperature error ε (T) of:

$$\begin{aligned} \varepsilon (T)&=2f^{2}b\\&=2\left( 1000 {\,s^{-1}}\right) ^{2}\left[ \left( 0.1 {\,px}\right) \left( \frac{0.001{m}}{3{px}}\right) \right] ^{2}\\&= 0.0022 {\,\frac{m^{2}}{s^{2}}} \end{aligned}$$

As PIV is subject only to the positioning error on the final point, the variance would be half of the variance for PTV. Further detail on the above deriviations is provided as Supplementary Material.

2.2 Particle tracking velocimetry

Particle Tracking Velocimetry (PTV) involves determining the location of each particle in successive frames, and using an algorithm to link the particle locations between the frames. As the results include tracking information on a particle basis, the results, in theory, are better suited to calculation of granular temperature than PIV. However, the accuracy of PTV is influenced by both particle location identification and matching particles between frames because the method reduces a particle to its centroid location and discards information about the particle’s appearance.

Fig. 3
figure 3

Comparison of classic PIV, Guided-PIV, and PTV methods, each for analyzing (a) high speed videos of distinguishable monodisperse particles. b The PTV and Guided-PIV methods begin by identifying particle locations. c The classic PIV method uses a regularly spaced grid of search subsets while (d) the Guided-PIV method uses the particle location results to center each search subset on a particle location. Both PIV and Guided-PIV use the full image information during matching, while (e) the PTV matching phase uses only the field of particle locations

PTV requires video frames with clearly distinguishable particles (Fig. 3a) as each particle must be identified and the centre-of-mass estimated (Fig. 3b). Particles in dilute flows, appearing with well-defined edges, may be detected using a single pixel intensity threshold (binarization) [13]. For dense flows, the Particle Mask Correlation (PMC) method [18] involves assuming an image of a representative particle (the “mask”) and calculating the cross-correlation between this mask and the image. The correlation score between the mask, centred on each pixel of the image, forms the basis for detecting particles. Local peaks in the correlation score are likely to be the centre of mass of the particles. To generate the mask, a two-dimensional Gaussian distribution is commonly utilized [19]. A further step is to then interpolate the fit of the particle mask on a sub-pixel basis (Sect. 2.4).

After the particle locations are identified, the next step in PTV is for a matching algorithm to determine the location of the same particle between successive frames (Fig. 3e). The simplest matching algorithm pairs the locations with minimum displacement. Matching algorithms for PTV also typically enforce that one particle in the first frame corresponds to one particle in the second frame.

If the matching algorithm incorrectly matches particle locations, the ‘wild vector’ that results will increase the calculated granular temperature. Wild vectors most commonly occur when the PMC step did not recognize a particle in one of the paired frames. To reduce wild vectors, various methods of matching and filtering have been proposed. The simplest is to tightly limit the search neighbourhood to the maximum probable travel distance. While this is compatible with simple direct matching, the flow velocity in terms of particle diameters per frame becomes a limiting factor in the matching success. Cross-correlation and displacement algorithms [20] compare the displacement of a potential matching pair to the average displacement of the adjacent group. Because they enforce a general measure of uniformity on the identified vectors, these methods are not suitable for the determination of granular temperature of highly collisional flows. Other proposed matching algorithms include a method based on Voronoï tesselation [7].

2.3 Particle image velocimetry

Particle Image Velocimetry (PIV) methods were developed for tracer particles in a fluid flow and essentially correlate textures between successive image frames. The original geotechnical application of PIV was to identify small displacements within continuum geomaterials. As such, great emphasis has been placed on developing improved shape functions utilized to interpolate the fits of the cross-correlation at a subpixel level. PIV consists of defining a region of the image as a subset or Interrogration Window, typically a square of 8 to 64 pixels per side, and searching for the location in the second (comparison) image where the best correlation is seen with the original subset location. The matching algorithms consider only the best correlation match within a prescribed search zone, similar to Minimum Displacement matching in PTV, owing to the small displacements expected within geomaterials. Popular implementations of PIV methods include PIVlab [21] and geoPIV [22].

Typically, the subsets are laid out in a regular grid pattern (Fig. 3e), and may or may not be overlapping. Here, we refer to this method as Grid-PIV. The original locations are not informed by a priori knowledge of particle locations. The size of the subset is typically set larger than a characteristic particle diameter and therefore typically contains multiple particles. Adrian and Westerweel [23] suggested the optimum range was 5–10 particles per subset.

For uniform, lightly shearing flows, the particles within a subset are not likely to move relative to each other. For flows with high rates of shear, such as in the vicinity of frictional boundaries, the position of the particles in the faster and slower moving layers will be different to each other, and thus the appearance of the subset would be different in the second image. This phenomenon, known as gradient biasing [24], has been subject to attempts to improve cross-correlation performance by deforming the sub-images using a multi-pass method.

However, for more collisional flows, the change in relative particle positions within a subset is not as easily determined, and these methods are not as applicable. PIV for subsets of multiple particles will have an inherent averaging effect, or suffer loss-of-correlation that precludes matching. Additionally, tracking information for individual particles is not available. It has been found that the identified granular temperature decreases as the size of the PIV subset increases [16, 25,26,27]. Sarno [27] has suggested a multi-pass approach where the size of the subset is systematically varied. Hart [28] proposed using progressively smaller subsets, down the order of one particle size. This method does not use a priori knowledge of particle locations but does use a priori knowledge of maximum displacement as results from subsets are used to limit the search distance for smaller subsets.

2.4 Image matching by cross-correlation on a subpixel level

At the heart of both the PIV and PTV methods is the requirement to match a search image to its location within a final image. An important difference between PIV and PTV is that in PTV the particle mask is utilized as the search subset for both the original and final image. For PTV, all particles are essentially identical during the matching phase, as only the identified location is input into the matching algorithm. This means that during the PMC phase any texture or differentiation between particles would typically worsen the scores. In contrast, the PIV matching algorithm uses a portion of the original image as the search subset and is aided by texture and differentiation between particles.

In both PIV and PTV, the cross-correlation method is utilized to identify the movement on the basis of whole pixels. To determine movement on a sub-pixel level, a method is required to interpolate these results and estimate the location of the maximum [22]. The definition of this sub-pixel estimation function is part of the technology of the method of image analysis. The PTV routine utilized in this paper uses MATLAB’s lsqcurvefit function to optimize the sub-pixel location and size parameters of the Gaussian mask to best fit the window of the final image. For PIV, a bi-cubic interpolant was utilized in the original geoPIV [29] and extended to a bi-quintic B-spline interpolant for geoPIV-RG [30]. PIVlab [21] fits a Gaussian distribution using up to nine points.

In this paper, the geoPIV software package [22] was used with a bi-cubic shape function and a B-spline function, respectively. The use of these two versions of the software does not represent a proposed novel improvement, but instead serves to demonstrate the capabilities of existing PIV software in comparison to PTV, for the purposes of determining the granular temperature of monodisperse granular flows.

3 Guided-PIV: PIV initiated with particle location information

As discussed above, PIV is typically deployed for granular flow analysis using a regular grid of search subsets (Fig. 3c). This often leads to averaging within the subset and/or poor correlation as the particles move relative to each other. As an alternative, a hybrid method of particle location identification and PIV tracking is proposed here for granular flows where the particles have a sufficient image diameter and are distinguishable in the images. The method seeks to locate the PIV subsets at the particle locations, limiting loss-of-correlation through relative particle movement in a shearing or collisional flow. Unlike tracer particles in a continuum fluid flow where the tracer particle displacements are representative of the continuum in which they transported, the particle displacement results in a collisional granular system need to be captured for all particles to mitigate bias. Enforcing one subset per particle and vice versa at PIV initiation is critical to obtain an image analysis displacement vector field that is representative of the true particle displacement vector field.

In this method, the particle locations determined by Particle Mask Correlation are used to initialize PIV for each pair of frames (Fig. 3d). We thus term the new method Guided-PIV. One PIV subset is centred at each identified particle location, and the subset size is set to the average particle diameter. The search zone is set to be slightly larger than the maximum expected particle movement, based on the results of an initial pass of PTV. By using PIV instead of PTV for measuring particle displacements, advancements made in PIV subpixel identification can lead to reduced noise in measurements. For flows of slightly irregular particles, the particle shapes and texture will generally aid matching with PIV as opposed to having a detrimental impact on PTV.

Note that Cowen and Monismith [31] proposed a hybrid technique where a deformation field was reconstructed from regularly spaced non-overlapping PIV interrogration windows, and PTV was used to determine the particle locations in that field. The currently proposed method differs from the Cowen and Monismith method in that the PIV interrogration windows are located after the particle locations have been determined, rather than a regular grid, and the subset sizes are set to the particle size.

4 Simulated flows and synthetic images

In order to explore the potential effects of errors in particle location determination from image analysis, it was desired to generate synthetic images from simulated flows where the particle positions are explicitly known to enable comparison of the true granular temperature and any measured values from imaging methods. A Discrete Element Model (DEM) using the MercuryDPM software [32, 33] was used to simulate a flow in a chute, inclined at \(24^{\circ }\), under steady-state conditions with the model parameters listed in Table 1. Particles which left the periodic boundary at the bottom of the chute reentered the model at the top of the chute. Figure 4 presents a visualization of the particles in the cell, with the color gradient representing particle velocity. The model is laterally confined by flat, rigid, and frictional sidewalls and was thus only singly periodic. The DEM returns the position of all 27,500 particles at a sample rate of 2000 Hz. Gollin et al. [34] provide further details on the specific DEM technique.

Table 1 Discrete Element Model parameters for flows constrained by frictional sidewalls. Superscript (\(^{w}\)) indicates wall contact; subscripts (\(_{n}\)) and (\(_{t}\)), normal and tangential parameters, respectively

For each frame, the model can be queried for particles close to the sidewall, designated as the ‘camera’ location. Synthetic images (Fig. 5a) were built by layering particles from back to front. Each particle was represented by a 2-D Gaussian distribution, with the parameters adjusted with distance from the ‘camera’ lens to simulate the shallow depth-of-field associated with a wide aperture lens.

Fig. 4
figure 4

Front and side views (a,b) of a flow, laterally confined by flat, rigid, and frictional sidewalls. The simulation domain is \(l_{x}\times l_{y}=30d\times 66d\) with a total of \(N=27500\) particles simulated. Glued (black) particles make the base bumpy and the colour gradient represents slow (blue) to fast (red) particles as z increases. Notably there is an additional influence of wall friction in the spanwise (y) velocity gradient. c flowing particle system. b taken from [34]

Fig. 5
figure 5

Representative frames from synthetic image exercises

In the following sections, exercises are conducted on these synthetic images where the granular temperature is known. In Sect. 5, two exercises are conducted on images where the particles do not move relative to each other, and thus the true granular temperature is zero. A third exercise is conducted in Sect. 7 on 1250 images of the simulated collisional flow. The true granular temperature can be calculated from the known particle positions and compared to the measured values.

5 Rigid body displacement exercises

5.1 Synthetic image exercise 1: subpixel accuracy

The accuracy of the subpixel estimation process has been shown to be influenced by the texture in the image as well as the choice of interpolation function. The phenomenon of PIV results that are biased towards integer values of displacement is known as ‘peak locking’. Stanier et al. [35] investigated this bias in the estimated subpixel components and found that the bias was higher for particles represented by fewer pixels. Murray et al. [14] performed a series of simple experiments and generated synthetic images to explore the sources of error affecting the determination of velocity and acceleration for non-deforming interrogation windows. The largest error source was found to be due to poor texture, leading to peak locking, and exceeded 0.1 pixels. In this way, the use of somewhat irregular particles is considered beneficial for PIV performance. The choice of shape function used for the subpixel interpolant led to an error on the order of \(0.01\,{px}\) for a cubic shape function, as opposed to \(0.001\,{px}\) for a B-spline function.

Here, a series of synthetic images was generated based on the first frame of the simulated flows, described in Sect. 4, to evaluate the sub-pixel accuracy in the determination of particle location for each method. In each image, the particle was moved \(0.025\,{px}\) horizontally (x direction). Over 40 frames, this corresponds to \(1\,{px}\) of movement. At each step, the error between the true position of the particle and the identified position of the particle was calculated. The error was calculated as the length between positions, so it follows that the error is always positive. The above process was completed for 4 rows (y direction) each \(0.33\,{px}\) apart. The errors were averaged over all rows (over all y) for each x (Fig. 6). Four particle diameters \(d_{p}\) were trialled: 5, 6, 12, and \(24\,{px}\). The PTV, Guided-PIV, and Guided-PIV-B-spline methods (Table 2) were included in this comparison.

Fig. 6
figure 6

Accuracy of subpixel estimator and peak-locking phenomenon

Table 2 Image analysis methods considered

The PTV method (Fig. 6a) returned very low average error values (\(<0.07\,{px}\)). This is not unexpected, as the image was generated using the same equation as that which the Particle Mask Correlation process utilizes. The error was highest for larger particle diameters. This confirms proper functioning of the subpixel algorithm for PTV.

The Guided-PIV method with bi-cubic subpixel interpolant (Fig. 6b) was suitable for particle (and subset) sizes of \(d_{p}=5\,{px}\) or larger. The average error is lowest for the larger \(d_{p}=24{\,px}\) particles, on the order of \(0.12{\,px}\). For the \(d_{p}=5{\,px}\) particles, the average error ranged up to \(0.24{\,px}\). These error values are considerably increased from those of PTV. When the Guided-PIV method is used with a B-spline subpixel interpolant (Fig. 6c), only particle sizes of 12 and \(24\,{ox}\) are suitable for the B-spline. The level of error reduces to a maximum of \(0.08{\,px}\) for the \(d_{p}=24{\,px}\) particles.

This exercise confirms that the PTV method can perform well when particles are similar to the mask. For PIV, it was seen that the sub-pixel estimation algorithm has a significant influence on accuracy.

5.2 Synthetic image exercise 2: noise floor of granular temperature measurements

To quantify the ‘noise floor’ of granular temperature as identified by the different image analysis methods, a verification exercise was undertaken using synthetic images of multiple particles in a flow field. The implications of the particle location identification error on granular temperature were previously shown in Sect. 2.1. In this exercise, the true granular temperature is zero as the particles do not undergo relative displacement. The synthetic images were analyzed using both PTV and the Guided-PIV methods (Table 2), and the errors in particle location identification are expected to manifest as a ‘false’ granular temperature.

The images were generated using the first frame of the simulated flow (Fig. 5a), but with a uniform horizontal displacement applied to each particle in each image ranging between \(0.3{\,px}\) to \(9.6{\,px}\) per frame. The movement per frame was intentionally chosen to not be a whole or half pixel, as these were previously shown to have the least error for PIV (Fig. 6b). The left and right boundaries were made periodic, such that as particles exited the frame, the particles entered the frame on the other side. Each particle was represented by a \(24{\,px}\) diameter Gaussian mask. Once again, these conditions are ideal for PTV as the search mask is identical to the mask used to generate the images.

Fig. 7
figure 7

Identified granular temperature, normalized by the square of mean flow velocity, as a function of particle movement (in terms of pixels per frame) for a synthetically generated image (\(d_{p}=24{\,px}\)) where no relative displacement occurs and thus the true magnitude of granular temperature is zero. The results illustrate a noise floor for granular temperature identification, with Guided-PIV performing at least one order of magnitude better. The optimum displacement for Guided-PIV for lowest noise is around 7.2 px/frame, as opposed to around 4.8 px/frame for PTV

Figure 7 illustrates the average identified granular temperature, normalized by the square of the average velocity. The noise is over one order of magnitude higher for PTV than Guided-PIV over the range of particle movements per frame trialled. Both methods illustrated a decrease in noise as movement per frame is increased, which was expected from Sect. 2.1, through \(4.8{\,px}\) displacement per frame. Guided-PIV demonstrated a minimum of noise at \(7.2{\,px}\) per frame, with an increase in noise at \(9.6\,{px}\). It is expected that for larger displacements, large errors could occur due to a breakdown of the matching algorithm (especially direct matching in PIV).

This exercise confirmed that granular temperature identification signfiicantly depends on the particle movement between frames, and that consideration should be made for this when selecting the analyzed frame rate for images. The exercise also produced promising results for Guided-PIV.

6 Tracking particle trajectories between frames

Considering the flow on a particle basis rather than a frame-by-frame basis can be instructional to help quantify and illustrate the influence of particle location misidentification on the granular temperature. A post-processing routine created chains of particle movement for the PTV and Guided-PIV results by matching the end points and start points of the displacement vectors in successive frames. Figure 8a illustrates the path of three representative particles from the simulated flow which undergo multiple collisions. The true particle path is shown from the DEM results, as well as the identified particle location from PTV. The Guided-PIV results are also shown as a cumulative sum of the displacement vectors from the start of the chain. Overall, the two tracking methods illustrate general agreement with the true particle locations.

Fig. 8
figure 8

True particle positions (from DEM) and the frequency spectra of apparent impulses on three representative single chains of particle motion. Also shown is a comparison of a particle location tracking and b frequency spectra of apparent impulses on the particle, for Guided-PIV and PTV methods

6.1 Comparison of impulse spectra

Spurious components of velocity vectors are discernable when considered in the context of particle movement across many frames. Considering a particle on a path (Fig. 9a), an error in determination of particle location would lead to a velocity vector with both a true component (the actual movement) and an errant component. In the next frame, the errant component would require an equal and opposite error component to return to the original path. Viewed over the entire chained path. the error components would have the property of alternating about the mean in each successive frame and be akin to high-frequency noise. We now explore using frequency-based methods to identify and filter out the error component during the measurement of granular temperature.

Fig. 9
figure 9

Schematic of a chained PTV displacement vectors representing the path of a particle, b decomposing the changes in velocity to perpendicular and inline impulse components, c a timeseries of the perpendicular and inline impulse components, which are subject to the DFFT to produce (d) a frequency spectrum of apparent impulses on the particle. The components less than the frequency of interest can be summed for calculation of granular temperature, with higher frequencies regarded as spurious

To analyze the apparent impulses on a frequency basis, it can be assumed that velocity changes of the particle are due to impulses at a right angle to the instantaneous direction of the particle, or directly in line with the particle’s instantaneous direction. Each orientation can include impulses in the positive or negative direction. The displacement vectors are decomposed into the vector projection (inline) and rejection (perpendicular) oriented to the displacement vector from the previous interval (Fig. 9b). For the rejection, the vector is compared with the current particle direction, and cast as negative or positive based on whether it acts to direct the particle to the left or right. For the projection, the scalar \(b_{1}=\Vert \mathbf{b }_{1}\Vert \) is compared with the original velocity \(\Vert \mathbf{a }\Vert \) to determine the scalar impulse.

When the particle motion is decomposed into these impulses, this produces a scalar signal of positive and negative values and a near-zero mean (Fig. 9c). This signal is suitable for transformation into the frequency domain by the Discrete Fast Fourier Transform (DFFT) (Fig. 9d). A series of equal magnitude impulses in alternating directions for each frame would manifest as a harmonic signal at the Nyquist frequency \(f_{n}\), defined as half the sampling frequency \(f_{s}\). The frequency spectra also has the property of being symmetrical about \(f_{n}\).

Using this method of impulse decomposition and spectral analysis, Fig. 8b) presents the frequency spectra of apparent impulses on the same particle trajectories as Fig. 8a). Results are presented for tracking by the PTV and Guided-PIV, as well as the true particle path from the simulation. The magnitude of impulses identified by Guided-PIV is similar to the the true particle path across the frequency spectrum. The magnitude of PTV impulses is much higher, which would lead to a much higher granular temperature result. There is also a frequency dependence visible in the PTV results (Fig. 8b) that is absent from the Guided-PIV results. The magnitude of the impulses generally increase up to \(f_{n}\). With a clear indication that the error in particle location identification is distinguishable on the frequency spectra of apparent impulses, we investigate the possibility of using a frequency-based filter (Fig. 9d) to improve the accuracy of measuring granular temperature from high-speed imagery of monodisperse granular flows.

6.2 Granular temperature on a particle basis

The granular temperature T of a particle can be related to the change in energy from a collision. If the particle had initial velocity \({\varvec{c}}_{a}\) before the collision and now has the final velocity \({\varvec{c}}_{b}\)

$$\begin{aligned} T=\frac{1}{3}\left\langle \left[ {\varvec{c}}_{b}^{2}-{\varvec{c}}_{a}^{2}\right] \right\rangle \end{aligned}$$
(4)

where \(\left\langle -\right\rangle \) denotes ensemble averaging over all particles. The 1/3 factor is a dimensional scaling factor similar to Eq. (3), and subject to the same considerations.

Assuming particle mass m, the momentum balance between three successive frames is:

$$\begin{aligned} m{\varvec{c}}_{a}+m{\varvec{v}}=m{\varvec{c}}_{b} \end{aligned}$$
(5)

where \({\varvec{v}}\) is the velocity fluctuation term.

If we consider impulse co-ordinates aligned with the initial direction of travel \({\varvec{c}}_{a}\), Eq. (5) may be expanded to be:

$$\begin{aligned} m{\varvec{c}}_{a}+m{\varvec{v}}=\left[ \begin{array}{c} c_{a,i}\\ 0\\ 0 \end{array}\right] +m\left[ \begin{array}{c} v_{i}\\ v_{p}\\ v_{q} \end{array}\right] =m\left[ \begin{array}{c} c_{b,i}\\ c_{b,p}\\ c_{b,q} \end{array}\right] =m{\varvec{c}}_{b} \end{aligned}$$
(6)

By Eqs. (4) and (6), the granular temperature can be expressed by the sum of impulses:

$$\begin{aligned} T= & {} \frac{1}{3}\left\langle \left\{ \left[ \left( c_{a,i}+v_{i}\right) ^{2}+v_{p}^{2}+v_{q}^{2}\right] -\left[ c_{a,i}\right] ^{2}\right\} \right\rangle \nonumber \\ T= & {} \frac{1}{3}\left\langle \left\{ 2v_{i}c_{a,i}+v_{i}^{2}+v_{p}^{2}+v_{q}^{2}\right\} \right\rangle \end{aligned}$$
(7)

For granular temperature of a chain of particle movement N intervals long, in each interval k:

$$\begin{aligned} T=\frac{1}{3N}\left[ \sum _{k=1}^{N}\left( 2v_{k,i}c_{k,i}\right) +\sum _{k=1}^{N}\left( v_{k,i}^{2}+v_{k,p}^{2}+v_{k,q}^{2}\right) \right] \end{aligned}$$
(8)

By Parseval’s theorem, the sums of the squares of the impulses \(\sum _{k=1}^{N}\left( v_{k,i}^{2}+v_{k,p}^{2}+v_{k,q}^{2}\right) \) may be taken from the time-domain series or the frequency spectra. When averaging over all chains to comprise the flow, the chain should be weighted by N to maintain equivalence to the ensemble average.

6.3 Impulse frequency filtering (IFF)

The potential for the error components to be distinguishable by frequency (Sect. 6.1) leads to the possibility of filtering the impulse series of a trajectory by frequency. The novel Impulse Frequency Filtering (IFF) method is based on the concept that modern-day high-speed cameras can produce images with a sufficiently high frame rate that the frequency of the apparent impulses brought on by misidentification of particle location is well above the actual frequency of particle collisions. A low-pass filter can be applied to the frequency series, the simplest of which would be a cut-off frequency (Fig. 9d). Here, after the DFFT is taken, the components smaller than the frequency of interest are summed and used in the calculation of the granular temperature (Eq. 7). In the application example (Sect. 7), the cut-off frequency was determined on a per-chain basis by considering the cumulative sum of the frequency components. The cut-off frequency was set as the lowest frequency where the average component value (from 0 Hz to the interested frequency) exceeded 1.5 times the average component value from 0 to 300 Hz.

7 Synthetic image exercise 3: simulated collisional flows

Here we present the results of a verification exercise to demonstrate the concept of distinguishing real collisions from the error component by using the frequency-filtering method, described in Sect. 6.3, and to validate the two proposed novel improvements for granular temperature determination. The exercise was conducted using the DEM results for a steady-state collisional flow (Sect. 4). 1250 sequential frames of the simulated flow were analyzed. For each frame, three images were generated, representing three levels of image quality. The particle locations are identical in each set of images. In the base case (Fig. 5a), the particles are represented by a Gaussian distribution identical to the search mask in the Particle Mask Correlation step.

In Fig. 5b, the same image has been corrupted by Gaussian white noise that is generated anew each frame by the MATLAB imnoise function. The standard deviation of the noise magnitude is 1.2% of the amplitude of the particle image. The noise simulates when the imaging sensor is amplified excessively. Experimental images may also be subject to optical imperfections which are persistent and stationary across the images. We simulated the case of scratched and smeared sidewall glass by merging a picture of a worn area of an experimental flume (Fig. 5c) onto the synthetic images (Fig. 5d).

The images were analyzed by the regular Grid-PIV, PTV, and Guided-PIV methods. Both PIV methods used bicubic subpixel estimation, a subset size equal to the particle diameter \(d_{p}=24{\,px}\), and a search zone size of \(5{\,px}\) in each direction from the edge of the search subset. All methods are able to correctly identify the velocity profile (Fig. 10), however in the scenario with scratched glass, both Grid-PIV and Guided-PIV slightly underidentify the velocity. The stationary scratches are likely the dominant feature in some subsets, resulting in zero movement identified for the subset.

Fig. 10
figure 10

Measurement of velocity profile by PTV and Guided-PIV methods

Fig. 11
figure 11

Measurement of granular temperature profile by PTV, Guided-PIV, and Grid-PIV methods. Frequency-based filtering of impulses applied to the PTV and Guided-PIV methods, shown as PTV-IFF and Guided-PIV-IFF, demonstrates an improvement in accuracy of granular temperature identification, except where sidewall glass was heavily scratched and smeared

A comparison was made of the granular temperature profile identified by each analysis method for each of the image sets (pure, noisy, and scratched sidewall glass) generated for collisional flow simulated by the DEM (Fig. 11). The “actual” granular temperature has been calculated using Eqs. (1)–(3) and true positions of the particles adjacent to the sidewall as exported from the DEM. Therefore, all compared quantities are the local granular temperature in the vicinity of the sidewall.

For the classic methods, Grid-PIV and PTV were trialled without frequency-based filtering. The regular Grid-PIV methods are found to systematically underpredict granular temperature for each of the image sets by up to approximately 30%. Each of the PTV cases also results in an identified granular temperature well in excess of the actual values, typically by a factor of 2 or more. For PTV, the lowest granular temperature result is for the ‘pure’ case, which overidentifies the granular temperature by at least 70% for the majority of the flow height. The addition of white noise to the image increases the measured granular temperature further by approximately 15%. The granular temperature for the ‘scratched glass’ case is much higher. The match is poorest in the lowest portion of the frame, where the glass has the highest opacity (Fig. 5d).

The proposed Guided-PIV method demonstrates results that are much closer to the actual granular temperature than both of the PTV and Grid-PIV results. The comparison for the ‘pure’ particles case is the closest to actual (within +/− 16%), followed by the ‘white noise case’ (overidentification up to 29%). The granular temperature is underidentified in the ‘scratched glass’ case, in which the velocity profile is also underidentified (Fig. 10).

The impulse-frequency-based filtering method, discussed in Sect. 6.3, was then applied to both the Guided-PIV and PTV results with the results termed Guided-PIV-IFF and PTV-IFF, respectively. With the frequency-based filter applied to the Guided-PIV results, the closest match to actual is seen for the images corrupted by white noise. For the pure images, the frequency filtering method results in a generally underidentified granular temperature. In the case of scratched and smeared sidewall glass, the filtering exacerbates the underidentification of granular temperature.

The frequency-based filtering method demonstrates the largest improvement for the PTV results. After filtering impulses by frequency, the ‘pure’ particle case follows the actual granular temperature profile within 15% for the majority of the dense flow height. The case with white noise improves as well, with the results within 20% of actual for the majority of the flow height. The case with scratched glass shows similar results in the upper portion of the flow, where the optical obstruction was not as pronounced, but continues to overidentify granular temperature in the lower portion of the flow.

8 Conclusion

Granular temperature, as a measure of the collisionality of a flow, is one of the two primary inputs in kinetic theories regarding particle pressure in a granular flow. The direct measurement of granular temperature is not possible, and is either inferred from backcalculation or approximated from image analysis. Recent advances in ultra-high-speed video cameras have enabled experiments to be recorded at higher frame rates, which in turn lends itself to capturing a more magnified image (in terms of pixels per particle). This may make it easier to track particles between frames as the relative movement between frames is minimized. However, Gollin [36] found that a decreased interval between analyzed images can skew the identified granular temperature.

A framework to relate sub-pixel errors to granular temperature measurements illustrated that even errors on the order of \(0.1{\,px}\) can increase the identified granular temperature by an amount similar to the ‘true’ granular temperature of many flows. As such, it is important that researchers understand the accuracy of their methods and understand the potential bias that the analysis method may have on granular temperature. In many cases, a higher resolution image captured at a higher frame rate may actually be detrimental to the accurate measurement of granular temperature.

Images captured at a higher framerate and each particle represented by more pixels are well-suited for PIV methods. The lower relative movement per frame allows for particle tracking with the matching guided only by a maximum search zone set to reasonable limits of particle movement between frames. Any available texture and differentiation is helpful for PIV to distinguish between particles and perform sub-pixel identification. However, early work with PIV has resulted in systematically lower granular temperature than the true value and hence a novel hybrid method of PIV was proposed, where for each frame the particle location information from the Particle Mask Correlation step of PTV is used to lay out the search subsets for PIV. This allows for one particle per subset in PIV, avoiding the inherent averaging effects or loss of correlation when a subset contains multiple particles.

Synthetic images were utilized to assess the ‘noise floor’ of granular temperature determinations from both the PTV and Guided-PIV methods. The Guided-PIV method returned over an order of magnitude less noise. The noise floor typically decreased as particle movement per frame increased, however, Guided-PIV illustrated a local minimum beyond which the matching algorithm begins to return false matches.

Synthetic images of a simulated collisional flow were analyzed in a verification exercise to check local granular temperature adjacent to a sidewall. The Guided-PIV method performed with much greater accuracy than Grid-PIV or PTV. The use of particle location information to initialize PIV is shown to reduce bias affecting granular temperature. This led to an improvement in ability to measure granular temperature over PTV (Fig. 11), using only a classical PIV algorithm.

A frequency-based method (IFF) was proposed to account for errors in the determination of particle location from video. This method was developed for the case where the video was captured at a much higher frame rate than frequency of collisions. The method sucessfully improved the accuracy of granular temperature measurement by PTV analysis.

Finally, a discussion must be had regarding error mitigation versus error suppression. Firstly, our results demonstrate that experimental considerations such as cleanliness of the sidewall glass and the quality of the lighting trump the relative differences between image analysis algorithms. Careful experimental procedure is recommended to mitigate errors. Secondly, the impulse-frequency-filtering (IFF) method is a method of error suppression, but when applied to PTV results was not able to perform better than the Guided-PIV method which produces much less error, even before filtering. The PTV-IFF method remains useful for the case of severely scratched glass sidewalls or particles displaying less texture. It also is likely applicable to internal images of a flow captured by advanced methods [12, 37] which do not display the level of detail required for PIV.