Overview
C++ library CvTracker is intended for automatic object video tracking. The library is written in C++ (C++17 standard) and is compatible with any processors and operating systems that support a C++ compiler (C++17 standard) and, optionally, CUDA Toolkit for forward and backward FFT operations. The library provides fast calculations, compatibility with low-power processors, high accuracy, and contains many additional functions and modes, which allow its use in camera systems of any configuration. It contains an advanced tracking algorithm CSRM developed by ConstantRobotics. The library provides tracking of low-contrast and small-sized objects against complex backgrounds. The library contains a description of the C++ class CvTracker. A single instance of the CvTracker class provides tracking of a single object in video. To track several objects simultaneously, several instances of the CvTracker class must be created. The CvTracker library depends on third-party libraries: VTracker interface library (defines programming interface, source code included, Apache 2.0 license) and cuFFT (linked, optional if platform supports CUDA, custom license similar to the BSD 2-Clause License). Additionally, the CvTracker demo application depends on third-party libraries: OpenCV open source library (for user interface, linked, version >= 4.5.0, Apache 2.0 license), FormatConverterOpenCv (provides functions to convert pixel formats, source code included) and SimpleFileDialog (file dialog library, source code included, Apache 2.0 license). During the CMake configuration step, the library determines whether CUDA support is available on the device. If CUDA is supported, the library will be compiled using cuFFT. The user can select the computation platform (CPU or GPU) in the library parameters at runtime.
Downloads
Documentation: GO TO DOCUMENTATION
Demo application v10.0.0 to test on your video (Windows x64): DOWNLOAD
Benchmark applications and demo libraries (time restricted) available by request for platforms: NXP IMX8 / IMX95, Jetson Nano, Jetson Orin, Raspberry Zero 2W, 4B, 5 and others
Performance
Processing time per one frame with different parameters. The library is using only 2 CPU cores in multithreading mode for daylight cameras and only 1 CPU core for thermal cameras. The results have been obtained with benchmark application which process 100 video frames and calculate average processing time per frame. The results for maximum search window size 256x256 pixel:
| Search window 256x256 | Thermal camera | Daylight camera | | Platform type | 1 CPU core | 2 CPU cores | | --------------------- | -------------------- | -------------------- | | Raspberry PI Zero 2W | 17.0 msec (58 FPS) | 22.0 msec (45 FPS) | | Raspberry PI 4В | 6.0 msec (166 FPS) | 10.5 msec (95 FPS) | | Raspberry PI 5 | 2.36 msec (423 FPS) | 3.25 msec (307 FPS) | | Jetson Nano | 5.95 msec (168 FPS) | 7.65 msec (130 FPS) | | Jetson Orin | 1.78 msec (561 FPS) | 3.4 msec (294 FPS) | | Intel i7-13700H | 0.82 msec (1219 FPS) | 0.90 msec (1111 FPS) |
Demo video
Simple interface
class CvTracker : public VTracker
{
public:
/// Get string of the library version.
static std::string getVersion();
/// Class constructor.
CvTracker();
/// Class destructor.
~CvTracker();
/// Init video tracker. All params will be set.
bool initVTracker(VTrackerParams& params) override;
/// Set video tracker param.
bool setParam(VTrackerParam id, float value) override;
/// Get video tracker parameter value.
float getParam(VTrackerParam id) override;
/// Get video tracker params (results).
void getParams(VTrackerParams& params) override;
/// Execute command.
bool executeCommand(VTrackerCommand id,
float arg1 = 0,
float arg2 = 0,
float arg3 = 0) override;
/// Process frame. Must be used for each input video frame.
bool processFrame(cr::video::Frame& frame) override;
/// Get image of internal surfaces.
void getImage(int type, cr::video::Frame& image) override;
/// Decode and execute command.
bool decodeAndExecuteCommand(uint8_t* data, int size) override;
};

