@@ -11,6 +11,12 @@ This section contains an assortment of common usage examples, taken from the rea
TGrabs
******
Ground-roules:
- Converting/recording has to be done before (or at the same time) as tracking!
- Everything that appears pink in |grabs| is considered to be noise. If |grabs| is too choosy in your opinion, consider lowering ``threshold``, change ``blob_size_range`` to include the objects that are considered noise, or enabling ``use_closing``!
- You should not delete your AVI after converting it to PV. Objects that are not considered noise, are saved losslessly in PV, but the rest is removed (that's the compression here).
Converting videos
=================
...
...
@@ -27,6 +33,22 @@ The background will be saved to a png file in the output folder. You can edit it
Record using a Basler camera
============================
Same options as above, but the input is different (note that you'll have to compile the software yourself in order to use this - with the Basler SDK enabled/installed on your system)::
tgrabs -i basler
Closed-loop
===========
To enable closed-loop, edit the ``closed_loop.py`` file (it contains a few examples) and open tgrabs using::
Now you also have to attach ``track_`` parameters and set everything up properly for tracking (see next section)!
Every frame that has been tracked will be forwarded to your python script. Be aware that if your script takes too long, frames might be dropped and the tracking might become less reliable. In cases like that, or with many individuals, it might be beneficial to change ``match_mode`` to ``approximate`` (if you don't need extremely good identity consistency, just general position information).
@@ -55,6 +55,8 @@ After compilation was successful, |trex| can be installed using::
Notice there is a ``-c local``, instead of the ``-c trexing`` from the first section.
Finally, to run it simply switch to the environment you just created (tracking) using ``conda activate tracking`` and run ``trex`` to see if the window appears!
Compiling manually
==================
...
...
@@ -85,11 +87,11 @@ Next, switch to the conda environment using::
You can now clone the repository and change your directory to a build folder::
Now we have to generate the project files for the given platform and compiler. The required CMake command varies slightly depending on the operating system. Within the environment, go to the ``FishTracker/Application/build`` repository (created in the previous step) and execute the compile script for your platform (on a Unix system ``../trex_build_unix.sh``, or on Windows ``../trex_build_windows.bat``) or execute cmake yourself with custom settings (have a look at the compile script for your platform for inspiration). You can also modify them, and add switches to the cmake commands.
Now we have to generate the project files for the given platform and compiler. The required CMake command varies slightly depending on the operating system. Within the environment, go to the ``trex/Application/build`` repository (created in the previous step) and execute the compile script for your platform (on a Unix system ``../trex_build_unix.sh``, or on Windows ``../trex_build_windows.bat``) or execute cmake yourself with custom settings (have a look at the compile script for your platform for inspiration). You can also modify them, and add switches to the cmake commands.
Regarding switches, TRex offers a couple of additional options, with which you can decide to either compile libraries on your own or use existing ones in your system/environment path -- see next section.
This page is a reference for some commonly used parameters of our software. Some common real-life usage examples can be found at :doc:`examples`.
Basic principles
----------------
Basic principles & Good practices
---------------------------------
Both |grabs| and |trex| offer many parameters that can be set by users. However, that does not mean that all parameters have to be considered in all cases. In fact, most of them will already be set to reasonable values that work in many situations:
...
...
@@ -24,6 +24,10 @@ Parameters are either changed directly as part of the command-line (using ``-PAR
If you know the number of individuals, specify before you do the tracking (using the parameter ``track_max_individuals``).
If you have more than 200 individuals and they are always in very close proximity to each other (or you get a lot of warnings), the tree-based matching method might be in trouble (combinatorically speaking). Consider changing your matching algorithm (``match_mode``) to ``approximate`` or ``hungarian``. These algorithms have down-sides to them, but they do scale better for many individuals. If you need something trustworthy: ``hungarian`` is the well-known Hungarian algorithm (https://en.wikipedia.org/wiki/Hungarian_algorithm)!