# X-ray Particle Tracking Velocimetry in an Overflowing Foam
## 2 Materials and Methods
### Image Processing and Particle Tracking  
The image processing and data analysis is divided into three subroutines: first, the pre-processing of the X-ray images as illustrated in Figure 6, second, the detection of the tracer particles and their motion paths, and third, the calculation of the translational velocity of each tracer particle and its intrinsic rotation along the motion path. The X-ray image sequences were pre-processed in order to display the metal beads of each tracer particle as bright spot on a dark background. To this end, the original grey-scale images (Figure 6a) were colour-inverted (Figure 6b) and next, a time-averaged background image (Figure 6c), acquired with the liquid foam but without any tracer particles, was subtracted from each frame of the X-ray image sequence. The background image sequence was recorded with the same imaging parameters at the beginning of the respective measurement run, i.e., before the foam carrying the tracer particles approached the region of interest at the weir. As the result of the background subtraction (Figure 6d) followed by histogram equalisation, the four metal beads of each tracer particle are displayed as bright objects. In addition, the three small rods in the tubes for adding the tracer particles into the foam flow are visible after subtracting the background. In addition, stream-like patterns of the foam flow are recognisable, suggesting that the liquid fraction of the foam could be quantified from the X-ray image sequences with high spatial and temporal resolution. The Matlab Particle Tracking Code developed by [PERSON] & Dufresne [51] was applied to the pre-processed X-ray images. The Matlab routine is an adaption of IDL Particle Tracking software originally developed by Crocker & Grier [52]. Using this software tool, the four metal beads of each tracer particle were detected in each single frame, and the found coordinates were linked to reconstruct the motion path of each metal bead in consecutive frames of the X-ray image sequences. Continuing from the reconstructed motion paths of the four metal beads belonging to one tracer particle, its translational velocity and intrinsic rotation were determined. The coordinates \(\mathbf{X}_{\mathbf{b}}^{i}=(x_{\mathbf{b}}^{i},y_{\mathbf{b}}^{i})\) were given for each of the four metal beads \(b\) in the respective  
Figure 6: Image pre-processing before detecting the tracer particles, particularly the four metal beads of each tracer: (**a**) the original grey-scale image (**b**) was colour-inverted and (**c**) the background image acquired without tracer particles (**d**) was subtracted. The positions of the three different tracers are highlighted by the red circles in each image. frames \(i\). The coordinates \(\mathbf{X^{i}}=(x^{i},y^{i})\) of the tracer particle were determined as its centre of mass estimated from:  
\[\mathbf{X^{i}}=\frac{1}{4}\sum_{j=1}^{4}\mathbf{X^{i}_{b}} \tag{5}\]  
Applying the central differencing scheme, the translation velocity \(\mathbf{U^{i}}=(v^{i}_{x},v^{i}_{y})\) of the tracer particle in the projection plane was calculated as  
\[\mathbf{U^{i}}=\frac{\mathbf{X^{i+1}-X^{i-1}}}{2\cdot\Delta t} \tag{6}\]  
with \(\Delta t=1/2\cdot(t^{i+1}-t^{i-1})=1/150\,\mathrm{s}^{-1}\approx 0.0067\, \mathrm{s}\) time increments. Here, the tracer particle was assumed to stay in the same measuring plane \(z=const.\), i.e., the translational velocity component \(v_{z}\) perpendicular to the projection plane equals zero. In addition, the intrinsic rotation of each tracer particle around the \(z\)-axis, i.e., in the projection plane, was determined by connecting all metal beads \(b=1\ldots 4\) with straight lines \(g=1\ldots 6\) and calculating the angle \(\alpha^{i}_{g}\) between each connecting line \(g\) and an arbitrary but fixed plane.