Once you are ready to track a video, you can launch
trackR by typing the following command in the R
In some occasions, like in the image on the left below,
trackR will not reconstruct the background completely. This
can happen, for instance, when an object did not move at all during the
entirety of the video like it is the case here.
You can fix some of these “ghosts” by clicking the “Select ghost for
removal” button. This will allow you to draw a polygon around the object
to remove from the background by using the left button of your
mouse/trackpad. Once you have surrounded the object with a polygon, use
the right button of your mouse/trackpad to close the polygon.
trackR will then use the pixels surrounding the polygon
that you traced to replace the object with its best guess about the
color of the background below it.
Once you are happy with background generated by
you can click the “Save background file” button to save the background
image for later (re)use.
trackR is done tracking the video, the resulting
CSV file will contain between 8 and 12 columns depending on whether you
have set a real-world scale and origin in the “Tracking module”. These
columns will be the following:
frameis the video frame number at which the measurements along the corresponding row have been made.
trackis the identity of the tracked object as estimated by
xis the x coordinate of the object location in pixels in the context of the video frame. The origin is set at the bottom-left corner of the frame.
yis the y coordinate of the object location in pixels in the context of the video frame. The origin is set at the bottom-left corner of the frame.
widthis the width in pixels of the object.
heightis the height in pixels of the object.
angleis the angle in degrees between the main axis of the object and the y axis.
nis the number of pixels covered by the object in the image. If you set the
Video qualityslider in the “Video module” to a value lower than 1, then this number if an approximation.
Plus, if you have set a real-world scale and origin in the “Tracking
x_[unit] is the x coordinate of the object
location in real-world [unit] The origin is set to the real-worl
equivalent to that you have defined in the “Tracking module”. +
y_[unit] is the y coordinate of the object location in
real-world [unit] The origin is set to the real-worl equivalent to that
you have defined in the “Tracking module”. +
is the width in real-world [unit] of the object. +
height_[unit] is the height in real-world [unit] of the
You can now proceed to the rest of the tutorials.
The video used throughout this tutorial was provided by Sridhar, V. H., Roche, D. G., and Gingins, S. (2019). Tracktor: Image-based automated tracking of animal movement and behaviour. Methods Ecol. Evol. 10, 691. doi:10.1111/2041-210X.13166 and used here with permission of the authors.