0% found this document useful (0 votes)
20 views6 pages

Janke 2020

This software package provides an open source MATLAB tool for particle tracking velocimetry (PTV) analysis. It can handle both double frame and time resolved image data. The key capabilities include particle detection, tracking between frames, and calculation of velocity fields. Additional post-processing functions allow further analysis of velocity data.

Uploaded by

shiva kamrani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views6 pages

Janke 2020

This software package provides an open source MATLAB tool for particle tracking velocimetry (PTV) analysis. It can handle both double frame and time resolved image data. The key capabilities include particle detection, tracking between frames, and calculation of velocity fields. Additional post-processing functions allow further analysis of velocity data.

Uploaded by

shiva kamrani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

SoftwareX 11 (2020) 100413

Contents lists available at ScienceDirect

SoftwareX
journal homepage: www.elsevier.com/locate/softx

Original software publication

Part2Track: A MATLAB package for double frame and time resolved


Particle Tracking Velocimetry

T. Janke , R. Schwarze, K. Bauer
Institute of Mechanics and Fluid Dynamics, TU Bergakademie Freiberg, Lampadiusstrasse 4, 09599 Freiberg, Germany

article info a b s t r a c t

Article history: Within this paper we present Part2Track, a MATLAB software package for the evaluation of 2D
Received 24 October 2019 Particle Tracking Velocimetry (PTV) measurements. Part2Track is not only capable of handling time
Received in revised form 30 January 2020 resolved image series but also double frame image sets, which are commonly recorded by standard
Accepted 30 January 2020
PIV systems. The following work covers a short description of the package’s functionalities and a
Keywords: performance analysis on synthetic images. In order to demonstrate the capabilities of handling realistic,
Particle Tracking Velocimetry experimental data, two test cases are provided.
PTV © 2020 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license
PIV (http://creativecommons.org/licenses/by/4.0/).
MATLAB
Part2Track

Code metadata

Current code version 1.0


Permanent link to code/repository used for this code version https://github.com/ElsevierSoftwareX/SOFTX_2019_335
Code Ocean compute capsule
Legal Code License BSD-3-Clause
Code versioning system used git
Software code languages, tools, and services used MATLAB
Compilation requirements, operating environments & dependencies Linux, macOS, Windows
MATLAB with following toolboxes:
Image Processing Toolbox
Statistics and Machine Learning Toolbox
Curve Fitting Toolbox
Signal Processing Toolbox
Parallel Computing Toolbox
If available Link to developer documentation/manual https://github.com/Part2Track/Part2Track/tree/master/doc
Support email for questions [email protected]
[email protected]

1. Motivation and significance seeded flows. Calculating the flow velocity from these images
is performed by dividing the whole image into smaller interro-
Laser optical measurement techniques for the determination gation windows and applying image cross correlation methods.
of global flow velocity fields have become a standard tool in Although the windowed cross correlation is very robust and has
experimental fluid dynamics. Many different set ups emerged been improved by various advanced techniques, it introduces
in the past, from which Particle Image Velocimetry (PIV) has spatial averaging effects in the final velocity vector calculation [1].
proven to be a versatile technique with a relatively easy installa- A closely related measurement approach, called Particle Track-
tion. The data obtained by PIV techniques are images of particle ing Velocimetry (PTV), can overcome this effect by tracking indi-
vidual tracer particles. If the majority of all particles are detected
∗ Corresponding author. and tracked, this method can enhance the spatial resolution and
E-mail address: [email protected] (T. Janke). increase the data yield per image [2].

https://doi.org/10.1016/j.softx.2020.100413
2352-7110/© 2020 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).
2 T. Janke, R. Schwarze and K. Bauer / SoftwareX 11 (2020) 100413

Originally, PTV has solely been used for the evaluation of


sparsely seeded flows. But over the time, PTV algorithms with
the ability to handle large amounts of particles have been devel-
oped (for example, see [2–4]). Whereas early PTV studies have
primarily been used to analyze time resolved image series, recent
approaches extended the method to cope with double frame
image data as well [4,5].
The MATLAB program Part2Track, introduced here, provides
an open source two dimensional PTV algorithm, based on state
of the art methods. Its main novelty is the implementation of
a double frame matching algorithm, which has not been freely
published up until now. Part2Track has been tested against a well
established, commercial software and could proof comparable
performance in the investigated case [6]. Furthermore, by the ad-
dition of complementary processing options, Part2Track broadens
the choice of already available software tools, e.g. openPTV [7],
PTVlab [8] or TracTrac [9].

2. Software description

2.1. Software architecture

Part2Track uses the MATLAB development framework to pro-


vide an easy and fast processing of the image data. The pre-
sented package consists of two main functions main_proc.m and
main_post.m, whereat main_proc.m contains all routines to con-
vert the image data to the final scattered velocity fields and
main_post.m is a collection of various post-processing functions
for a deeper analysis of the velocity data.
A schematic overview of the main processing script is given
in Fig. 1. Within this script, the images and all processing param-
eters are required as input values. In a next step, the algorithm
switches between the double frame image evaluation or the time Fig. 1. Schematic representation of the main processing routine.
resolved processing. The functions are called for the defined num-
ber of time steps/images and after completion of the tracking, the
results are saved in binary .mat files. methods are implemented to interpolate the scattered data on a
regular grid with adjustable grid sizes and interrogation windows.
2.2. Software functionalities The first is a Gaussian-weighted binning and the second is a
binning based on second degree polynomial interpolators [13].
Different further post processing routines are implemented
As already indicated, the software is capable of handling dou-
as well, e.g the calculation of turbulent kinetic energies, vor-
ble frame and time resolved image sets. For the case of double
tex detection, peak locking checking [14] and a simple Proper
frame data, a simple nearest neighbor matching and a method ca-
Orthogonal Decomposition (POD) analysis.
pable of handling higher particle densities (adopted and extended
from [4]), called histogram matching in Part2Track, are imple-
mented. The main function of the analysis of time resolved data 2.3. General parameter description
is a four-frame matching algorithm [10], which can be initialized
by one of the two aforementioned double frame methods. All general parameters are saved in a separate MATLAB (.m)
A sub-pixel accurate detection of the tracer particles is script file, which is imported at the beginning of the main pro-
achieved by a Laplacian of Gaussian image filtering technique, cessing routine. The first set of parameters includes important
followed by a Gaussian interpolation of the particle peak intensi- information about the experiment. These are the image acquisi-
ties. This particle detection method is adopted from the TracTrac tion mode (double frame or time resolved), the resolution of the
software [9]. It has to be noted, that Part2Track is developed recorded images, the number of images/double frame pairs, the
under the requirement of working with bright particle images time separation, the linear conversion scale mm/px and at last a
against a clean, dark background. Therefore, the user needs to pre-defined image mask.
remove any background distortions and non-particle objects from The next block of parameters controls the displacement cal-
the images before the processing. culation. Within this block, parameters for the particle detection
During the iterative matching process, an universal outlier (size and brightness), the particle matching (method, field of
detection [11] (adopted to work with scattered velocity data [12]) search, size of particle neighborhood), the outlier detection (size
is incorporated to enhance the quality of the displacement field of particle neighborhood, threshold for validity and noise) and the
reconstruction. multi pass approach (number of iterations) can be defined. For
The result by running Part2Track is a list of scattered velocity time resolved measurements, the admissible error for the further
vectors. However, for many further analysis it is more conve- trajectory linking can be set as well as the number of trajectory
nient to work with structured velocity fields. Thus, two binning reconstruction steps during the first initialization.
T. Janke, R. Schwarze and K. Bauer / SoftwareX 11 (2020) 100413 3

2.4. Performance test Table 1


Overview of all processing parameters for the synthetic performance analysis
and the two provided test cases.
Using synthetic images with known properties, the program’s
Parameter Synthetic data Lung Pipe
performance with respect to the reconstruction quality of the
velocity vectors can be tested. As the double frame evaluation p_size 2 3 3
p_int 40 3000 3000
is assumed to be more challenging, since no further temporal track_method hist_match hist_match hist_match
information is accessible, the test conducted here is limited to f_o_s 25 25 15
the double frame histogram matching algorithm. Four criteria n_neighbors 25 25 25
are chosen to demonstrate the capabilities and limitations of the n_outlier 25 25 25
thr 2 2 2
algorithm. These criteria are the particle detection rate, the error
noise 0.1 0.1 0.1
in estimating the particle’s center of mass, the particle matching n_outl_iter 3 3 1
rate and the final error in the local displacement calculation. n_mp 3 3 1
While the calculations of the detection rate and the position min_dist – – 1
error are straight forward, the evaluation of the matching rate is n_mp_ti – – 3
little bit more complex. The validity of a particle match depends
mainly on three constrains: (i) the difference between predicted
particle displacement and attributed displacement is within a The results covering the displacement error (shown in
5 px error range, (ii) the displacement vector passes the universal Fig. 3(d)), combined with the particle matching rate, suggest an
outlier detection test and (iii) the linked particles are matched optimal seeding density range (ppp = 0.0025–0.05) for the chosen
unambiguously. If all of these three criteria are met, the particle processing parameters. In this range, the calculated displacement
pair is considered to be trustworthy. The number of these valid error lies in a range of 0.63–1.6%. Outside of this optimum, the
particles is divided by the number of detected particles to obtain velocity field shows significant alterations, especially at the image
the particle matching rate. Since not all particles are matched boarders.
with their true corresponding particle in the next time frame,
the displacement error between the true displacement and the 3. Illustrative examples
reconstructed displacement is calculated.
The simulated flow represents the so called Taylor–Green- 3.1. Double frame data
Vortex, for which the velocity field is defined in our case as
In order to demonstrate the evaluation of double frame im-
u(x, y) = umax · cos(x · 2π/H) · sin(y · 2π/L) (1)
ages, test data is provided along with the source code. The im-
v (x, y) = −vmax · sin(x · 2π/H) · cos(y · 2π/L), (2) ages were recorded during a PIV measurement campaign cov-
ering the flow within the conductive human airways [15]. The
where H denotes the height and L the length of the considered
test case can be accessed by setting the evaluation folder to
image domain. Since the methods used to create the synthetic
..\test_cases\double_frame\Lung\. The measurement pa-
particle images are explained in detail in [14], just the main
rameter file already exists and does not need to be created. An
parameters for the image creation shall be summarized here. All
exemplary double pair image (overlapped and inverted) is shown
synthetic images have a resolution of 512 × 512 px and a bit
in Fig. 4(a).
depth of 8 bit. The particle diameter is set to 3 px, whereas the
The particles are imaged with a diameter of approximately 3-
seeding density measured in particles per pixel (ppp) is varied 8 px. Since the camera, used for recording the images offers a bit
from 0.001 to 0.1. A maximum particle displacement (umax = depth of 14 bit, the maximum intensity of a single pixel ranges
vmax ) of 10 px is allowed. For each seeding density a total number up to 16383. The particle detection intensity for this case can be
of 500 image pairs, with particles being placed randomly, are set at around 3000 counts.
created. All image pairs are evaluated according to the afore- Despite having a moderate particle seeding density, the simple
mentioned performance criteria, from which the mean values nearest neighbor matching approach would lead to low qual-
are deduced. The flow field, as reconstructed by Part2Track, is ity results, as the particle displacement is still larger than the
exemplarily shown in Fig. 2 for three different seeding densities mean inter-particle distance. Therefore, the histogram matching
as well as a corresponding cut out (32 px × 32 px) of a single algorithm should be used. As suggested by Fuchs and Kähler [4]
synthetic image. the field of search can be set to twice the expected maximum
A fixed set of processing parameters is defined (see Table 1) displacement. In this case, the image time separation leads to
and no further adjustments across the different seeding densities displacements of around 5–8 px. The field of search is set to 25 px,
are made. This may not be optimal as the later results suggest, to capture every particle movement and to show the robustness
but shall demonstrate how sensitive or robust the algorithm can of this method. The number of neighbors to be included in the
handle these differences. displacement calculation is 25. This neighborhood is also used for
The results of the performance analysis are plotted in Fig. 3. the universal outlier detection.
It has to be noted, that only vectors within the inner 75% of the Since the flow velocities range from high velocity regions
image (see Fig. 2) are considered to neglect the effect of vanishing to areas with approximately zero displacement, the multi pass
particles at the boarders. Nearly all particles can be detected for functionality is used. Three passes for the outlier detection and
the lowest investigated seeding density. As the particle per pixel three steps for reaching the maximum field of search are set for
value increases to 0.1, the detection rate decreases significantly this test case. A close up of a reconstructed instantaneous velocity
to approximately 40% (see Fig. 3(a)) due to an increase of over- field is illustrated in Fig. 4(b). In addition, the positions of all
lapping particle. As a result, the particle position error also rises detected particles in the first image are indicated as well. This
from initially 0.01 px at ppp = 0.001 to 0.23 px for ppp = 0.1 (see shows, that the majority of all tracers could be matched. A subset
Fig. 3(b)). (every tenth vector) of all reconstructed velocity vectors for all
At least 90% of all detected particles are matched validly in provided image pairs is plotted in Fig. 4(c). From these scattered
a range of ppp = 0.0025–0.05 (see Fig. 3(c)). For the smallest positions, a structured velocity field (see Fig. 4(d)) with a grid
seeding density, the matching rate drops to 68%, whereas the spacing of 8 px is deduced by the polynomial binning approach
decrease is less steep for the two highest particle numbers. (circular bin diameter/interrogation window: 16 px).
4 T. Janke, R. Schwarze and K. Bauer / SoftwareX 11 (2020) 100413

Fig. 2. Absolute displacement field δ for the Taylor–Green-Vortex test case for three different seeding densities (top row). Raw image crops (bottom row) illustrate
the seeding density within a 32 × 32 px area (small, dashed rectangle). For the error analysis only the velocity information within the solid, large rectangle is
considered.

Fig. 3. Results of the synthetic image evaluation. (a) Particle detection rate, (b) particle position error, (c) particle matching rate and (d) displacement error.

3.2. Time resolved data particle trajectories. Therefore, the time resolved algorithm is
used. By setting the evaluation folder within the main script to
As a next example, the flow analysis inside a bent pipe is
..\test_cases\time_resolved\Pipe\, the test case can be
demonstrated (see Fig. 5(a)). The data originates from high speed
PIV measurements [16] and allows the observation of whole started.
T. Janke, R. Schwarze and K. Bauer / SoftwareX 11 (2020) 100413 5

Fig. 4. Illustration of the double frame test case Lung. (a) Overlapped double frame image pair (inverted and with added boundaries for better visibility), (b) crop
out (see (a)) of instantaneous scattered vector field with detected particles, (c) ensemble scattered vector field (every 10th vector is shown) of all images and (d)
ensemble averaged structured velocity field.

The chosen processing parameters are similar as in the double living cells. By modifying the detection routine for these tasks,
frame experiment (see Table 1). But two further values have to Part2Track can quickly be used to study the motion of such
be set. These are the allowed error between predicted particle objects as well.
position and detected position as well as the number of iterative
initialization steps. The values will be 1 px and 3 iterations. 5. Conclusions
An image overlay of four consecutive time steps is presented
in Fig. 5(b), which already gives an impression of the occurring We presented the novel MATLAB software package Part2Track.
flow structure. The obtained trajectories by the PTV analysis are Part2Track is able to analyze double frame and time resolved 2D
plotted in Fig. 5(c), where the paths are color coded according to PTV image data. Various recent methods, such as a histogram
their local streamwise velocity. An ensemble polynomial binning matching method or ensemble bin averaging using polynomial
leads to the structured velocity field (see Fig. 5(d)). The bins have interpolations, are implemented within Part2Track. An analysis
a size of 16 px and the grid spacing is 8 px in each direction. using ideal synthetic image data demonstrated the good perfor-
mance across a large range of seeding densities without the need
4. Impact of changing major processing parameters. Two test cases were
introduced and briefly described to gain a better understanding
The main contribution of this work is to provide a freely of the use of Part2Track for real experimental applications.
available and extended source code for the double frame image
analysis of PTV measurements based on the particle matching Declaration of competing interest
method by Fuchs and Kähler [4]. As the development of the
software package progressed, a method for the evaluation of time The authors declare that they have no known competing finan-
resolved image sets has been added as well. Now, Part2Track cial interests or personal relationships that could have appeared
offers a complete 2D PTV image analysis software package for to influence the work reported in this paper.
the two most important image recording strategies found in PIV
and PTV experiments. Since Part2Track can handle dense particle Acknowledgments
images, previously recorded PIV image data can easily be rean-
alyzed with Part2Track to increase the spatial resolution of the The financial support of this study by the Deutsche Forschungs-
measurements or to gain new insights by the Lagrangian results. gemeinschaft, Germany (DFG grant No. BA 4995/2-3) is gratefully
As Part2Track is developed within the MATLAB framework, acknowledged. We would also like to thank Johannes Burkert for
which is commonly used in the engineering field, it takes ad- providing the time resolved image data.
vantages of MATLAB’s optimized internal functions to offer a fast
evaluation of the data and an easy interface for the implementa- Appendix. Experimental parameters
tion of own algorithms.
The tracking of different objects is a reoccurring task in many See Table A.2.
research fields, e.g. the tracking of large crowds of people or
6 T. Janke, R. Schwarze and K. Bauer / SoftwareX 11 (2020) 100413

Fig. 5. Illustration of the time resolved test case Pipe. (a) Sketch to illustrate the field of view within the bent pipe and main flow direction, (b) overlapped images
of four consecutive time steps (inverted for visibility), (c) reconstructed trajectories and (d) ensemble averaged structured velocity field.

Table A.2 [6] Janke T, Schwarze R, Bauer K. PIV-PTV comparison of the oscillating flow
Summary of experimental parameters for the introduced illustrative examples. inside the human lungs. In Proceedings of the 13th International Symposium
Lung data from [6], pipe bend data from [16]. on Particle Image Velocimetry; 2019. p. 232–8.
Lung Pipe bend [7] OpenPTV Consortium. openPTV. 2013, www.openptv.net.
[8] Brevis W, Niño Y, Jirka GH. Integrating cross-correlation and relaxation
camera type CCD CMOS
algorithms for particle tracking velocimetry. Exp Fluids 2011;50(1):135–47.
resolution 1600 × 1200 1280 × 800
http://dx.doi.org/10.1007/s00348-010-0907-z.
pixel pitch 7.4 µm 20 µm
[9] Heyman J. TracTrac: A fast multi-object tracking algorithm for motion es-
lens 105 mm, f# 3.5 90 mm, f# 5.6
timation. Comput Geosci 2019;128:11–8. http://dx.doi.org/10.1016/j.cageo.
laser double-pulse Nd:YAG high-speed Nd:YLF
2019.03.007.
inter-frame delay 160 µs 1/1300 Hz
[10] Malik NA, Dracos T, Papantoniou DA. Particle tracking velocimetry in three-
mapping scale 0.041 mm/px 0.075 mm/px
dimensional flows Part II: Particle tracking. Exp Fluids 1993;15(4):279–94.
tracer diameter 50 µm 50 µm
http://dx.doi.org/10.1007/BF00223406.
[11] Westerweel J, Scarano F. Universal outlier detection for PIV data. Exp Fluids
2005;39(6):1096–100. http://dx.doi.org/10.1007/s00348-005-0016-6.
[12] Patel M, Leggett SE, Landauer AK, Wong IY, Franck C. Rapid, topology-based
References particle tracking for high-resolution measurements of large complex 3D
motion fields. Sci Rep 2018;8(1):5581. http://dx.doi.org/10.1038/s41598-
[1] Kähler CJ, Scharnowski S, Cierpka C. On the resolution limit of digital 018-23488-y.
particle image velocimetry. Exp Fluids 2012;52(6):1629–39. http://dx.doi. [13] Agüera N, Cafiero G, Astarita T, Discetti S. Ensemble 3D PTV for high
org/10.1007/s00348-012-1280-x. resolution turbulent statistics. Meas Sci Technol 2016;27(12):124011. http:
[2] Stitou A, Riethmuller ML. Extension of PIV to super resolution using PTV. //dx.doi.org/10.1088/0957-0233/27/12/124011.
Meas Sci Technol 2001;12(9):1398–403. http://dx.doi.org/10.1088/0957- [14] Raffel M, Willert C, Scarano F, Kähler CJ, Wereley ST, Kompenhans J.
0233/12/9/304. Particle Image Velocimetry - A Practical Guide. 3rd ed.. Springer-Verlag;
[3] Ohmi K, Li HY. Particle-tracking velocimetry with new algorithms. Meas 2018, http://dx.doi.org/10.1007/978-3-319-68852-7.
Sci Technol 2000;11(6):603–16. http://dx.doi.org/10.1088/0957-0233/11/6/ [15] Janke T, Koullapis P, Kassinos S, Bauer K. PIV Measurements of the
303. siminhale benchmark case. Eur J Pharmaceut Sci 2019;133:183–9. http:
[4] Fuchs T, Hain R, Kähler CJ. Non-iterative double-frame 2D/3D particle //dx.doi.org/10.1016/j.ejps.2019.03.025.
tracking velocimetry. Exp Fluids 2017;58(9):119. http://dx.doi.org/10.1007/ [16] Burkert J, Schwarze R, Bauer K. Transitional flow in a 90◦ pipe bend. In Pro-
s00348-017-2404-0. ceedings of the 13th International Symposium on Particle Image Velocimetry;
[5] Cornic P, Leclaire B, Champagnat F, Besnerais GL, Cheminet A, Illoul C, 2019. p. 783–90.
Losfeld G. Double-frame tomographic PTV at high seeding densities. Exp
Fluids 2020;61(2):23. http://dx.doi.org/10.1007/s00348-019-2859-2.

You might also like