Normality test
Considering a sequence of N PIV images, for each pixel, the evolution in intensity across the image sequence can be extracted. Pixel intensities pertaining the imaged flow region will be characterized by strong alternations of high and low values due to the passage of tracer particles. Corresponding intensity probability density functions consequently exhibit a strong skewness (Fig. 1). Conversely, pixels associated with the imaged object display intensity variations principally due to camera noise, which is typically normally distributed (Westerweel 2000). Based on this observation, the authors propose a method to automatically categorise pixels within PIV images, by means of a pixel-wise normality tests. Given that the proposed methodology is based on probability density functions, validity is independent of the temporal resolution in the acquired images.
Normality tests are a tool to compute the likelihood of a set of data to be modelled by a Gaussian probability density function (PDF). Existing literature offers several tests for normality such as D’Agostino’s K-squared test (D’agostino et al. 1990), the Kolmogorov–Smirnov test (Fasano and Franceschini 1987), the Pearson’s Chi-squared test (Plackett 1983), etc. Lead by simplicity of implementation, the method of choice in the current work is the Jarque–Bera test, for which the heuristic can be easily evaluated on the basis of data skewness and kurtosis (Jarque and Bera 1987).
For a set of observations x (i.e., the set of intensity values of same pixel) with mean μ and standard deviation σ, the skewness s and kurtosis k are defined as:
$$\begin{aligned} s = \frac{{E\left( {x - \mu } \right)^{3} }}{{\sigma^{3} }} \hfill \\ k = \frac{{E\left( {x - \mu } \right)^{4} }}{{\sigma^{4} }} \hfill \\ \end{aligned}$$
(1)
where E(t) represents the expected value of t. For a normally distributed data set, the expected value of the kurtosis will equal 3 with a skewness of 0. The Jarque–Bera statistic quantifies the data set discrepancies from these expected ideal values:
$${\text{JB}} = \frac{N}{6}\left( {s^{2} + \frac{{\left( {k - 3} \right)^{2} }}{4}} \right)$$
(2)
where N is the size of the sample x (i.e., number of PIV images). The statistic expressed by (2), under the null hypothesis of x being normally distributed, is asymptotically distributed as a Chi-squared with two degrees of freedom (Jarque and Bera 1987). Thanks to this assumption, the p value for the Jarque–Bera test can be evaluated as:
$$p = 1 - \chi_{(2)}^{2} \left( {\text{JB}} \right)$$
(3)
where the general Chi-squared with ν degrees of freedom is defined as:
$$\chi_{(\nu )}^{2} \left( x \right) = \int_{0}^{x} {\frac{{t^{{\left( {\nu - 2} \right)/2}} e^{ - t/2} }}{{2^{\nu /2} \varGamma \left( {\nu /2} \right)}}{\text{d}}t}$$
(4)
with Γ being the gamma function:
$$\varGamma (x) = \int_{0}^{\infty } {t^{x - 1} } e^{ - t} {\text{d}}t.$$
(5)
Given a p value for each pixel of the image, the null hypothesis of normality can be accepted (noise-dominated region) or rejected (flow region) based on the comparison with a cut-off level. This level is typically set to 0.05 (Jarque and Bera 1987).
The aim of the presented work is not to test the normality of boundary pixels in an absolute sense, but rather to discern them from regions of strong non-normality due to the presence of particle images. Empirical studies lead the authors to conclude that flow regions are typically characterized by extremely low p values, whereas regions void of any signal usable for cross correlation usually present p values which can be several orders of magnitude higher (Fig. 2). Once the p value is evaluated for each image pixel, an automatic threshold exploiting the peculiar bimodality of the probability in p values across the image can be adopted to discern low p values (image regions of interest) from high p values (statistically irrelevant regions) to generate a binary mask. In the current work, the Matlab function otsuthresh was used as implementation of Otsu’s method (Otsu 1979), together with a median filterFootnote 1 of a fixed 3 by 3 kernel to enhance the bimodality of the histogram (Gonzalez et al. 2013). The reader should note that this automatic implementation of the threshold ensures a robust distinction of flow from object areas even when related pixels are not perfectly normally distributed, as flow regions will continue to have a much lower distribution of p values due to their more skewed pdf as corroborated by the theoretical intensity pdf suggested by Westerweel (2000).
Pre-processing
The assumption of normally distributed noise can be violated when the laser light intensity varies across the image sequence, producing artificially skewed histograms of pixel intensity. An example of this behaviour is shown in Fig. 3a and b, where a normally distributed pixel intensity was combined with a decreasing average light intensity. The histogram produced by this light distribution could easily be mistaken for a particle image, as it is not normally distributed. However, even exceptional cases like this do not prevent the application of the proposed mask detection algorithm, since a simple additional pre-processing step can be implemented to equalize the light intensity. For example, a high pass filter can be applied to the time history of the intensities of the individual pixels to reduce the effect of the light variation and restore the Gaussian shape of the histogram. The high pass filtered signal is presented in Fig. 3c, together with its normally distributed histogram in Fig. 3d.
Another common scenario where the hypothesis of normally distributed noise could be violated is in case of a double pulsed laser. Due to the possible discrepancies in manufacturing of the laser cavities, the light intensity of the two consecutive PIV images might be different, producing two sets of images that have a skewed or bimodal intensity distribution. In such a case, the authors suggest to apply the mask detection algorithm independently on the two image sets, producing two different masks of which the logical union can be used as final mask.
Minimum number of images required
Besides a sufficient number of images to ensure validity of the normality statistics, a secondary condition for the proposed methodology to work is that each pixel of the flow region should be occupied by a particle image at least once in the entire PIV sequence. The number of images based on the first condition depends on the image quality and consequently cannot be estimated a priori. The second condition, on the other hand, can be exploited to estimate an absolute minimum number of images necessary to allow the correct functioning of the mask detection. The probability of having n particles in a control volume V follows a Poisson distribution (Adrian 1983):
$$\Pr \{ n{\text{ particles in }}V\} = \frac{{s^{n} }}{n!}e^{ - s}$$
(6)
where s is the seeding particles concentration. The probability of a pixel of being occupied by a particle image at least once in a sequence of N images is described by a binomial distribution. From Eq. (6), for n = 1, follows:
$$\Pr \{ 1 {\text{ particle per pixel}}\} = 1 - \left( {1 - s \cdot e^{ - s} } \right)^{N} .$$
(7)
Equation (7) can be used to estimate a necessary number of images N, for a given probability Pr. Equation (7) is graphically presented in Fig. 4 and is indicative of the applicability of the method.