The cameras use a fork of tkDNN to record data. If the system is installed to site, all calibration and data analysis can be done as postprocessing. The files saved by the system are json-files for the detection and background-images.
Calibration and postprocessing involves these steps
After obtaining a background image, precise global positions for static points in the image shpuld be obtained. Consider satellite imagery, or own measurements with a RTK GNSS receiver. Follow README_calibration.md
With a valid calibration and a config file (you can check them with test_global_utm_calib.py), trajectory files can be created. As a reference implementation, a SORT-Tracker is used for now to work on single camera scenes (sort_create_bcrtf.py). Adding a deepSORT-Tracker for reidentification of obscured objects and among multiple cameras is work in progress.
A sample application is provided with read_trajectories.py .
Work in Progress: A GUI for loading images from the system, marking spots with known global position coordinates and generating a calibration.
Intrinsic camera calibrations of Logitech Brio cameras used in the project
Tool for marking spots in images from the system for manual calibration
Tool for generating intrisic calibration from a series of opencv-chessboard-markers takinf from different perspectives.
Python-classes and functions used by the programs in the root directory, no standalone programs in here.
Scripts for batch processing of recorded files
Submodule for SORT
Python classes used by sort_main.py and sort_create_bcrtf.py
Files from an obsolete tracking algorithms, however some files are still used, for example for openCV-camera init.
Create trajectory files from recorded json files, using the SORT-Tracker Usage
python sort_create_bcrtf.py inputfile.json -c configfile.ini
Tool for reading bcrtf-files, doing postprocessing, analyzing and visualization
Usage
python read_trajectories.py inputfile.bcrtf -c configfile.ini
When executed with a valid config file, it will show the reference points for calibration and hint to the projection error by showing the transformed global coordinates in the image.
python test_global_utm_calib.py -p config.ini
Install eigen3 and tk
sudo apt-get install python3-tk
sudo apt-get install libeigen3-dev
These tools have been tested with Python>=3.7, any newer versions should be fine.
sudo apt-get install python3.7
sudo apt-get install python3.7-dev
apt-get install python3.7-venv
Install pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
Install Python virtual environment
sudo pip install virtualenv virtualenvwrapper
Configure virtualenvwrapper with these lines in your .bashrc
# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
Create virtual environment for this project
mkvirtualenv capereviso-tools -p python3
Activate the environment inside the setup shell
workon capereviso-tools
install current pip and all required Python packages
pip install --upgrade pip
pip install -r requirements.txt
OpenCV is not included in requirements.txt, if you want to use your CUDA-accelerated installation, follow https://pyimagesearch.com/2020/02/03/how-to-use-opencvs-dnn-module-with-nvidia-gpus-cuda-and-cudnn/
otherwise install opencv-python
pip install opencv
Consider getting a newer CMake, if you encounter problems building the newest openCV: https://apt.kitware.com/
git clone git@github.com:hlrs-vis/capereviso-trajectory-tools.git
cd capereviso-trajectory-tools/
Sync submodules
git submodule sync
Init submodules
git submodule update --init --recursive
pip install -r requirements.txt