Modern C++ Multi-Object Tracking Library
Features โข Installation โข Quick Start โข Trackers โข Benchmarks โข Documentation
motcpp is a high-performance, production-ready C++ library for multi-object tracking. It provides state-of-the-art tracking algorithms with a clean, modern C++17 API designed for real-time applications.
- ๐ฏ 9 State-of-the-Art Trackers โ SORT, ByteTrack, OC-SORT, DeepOC-SORT, StrongSORT, BoT-SORT, BoostTrack, HybridSORT, UCMCTrack
- โก Blazing Fast โ Optimized C++ implementation, 10-100x faster than Python equivalents
- ๐ง Easy Integration โ Modern CMake, single-header option, vcpkg support
- ๐งช Well Tested โ Comprehensive unit tests with >90% code coverage
- ๐ฆ Cross-Platform โ Linux, macOS, Windows
- ๐ Flexible ReID โ ONNX Runtime backend for appearance embeddings
- ๐ MOT Benchmark Ready โ Built-in evaluation tools for MOT17/MOT20
| Tracker | HOTAโ | MOTAโ | IDF1โ | FPS |
|---|---|---|---|---|
| SORT | 62.4 | 75.2 | 69.2 | 1250 |
| ByteTrack | 66.5 | 76.4 | 77.6 | 1100 |
| OC-SORT | 64.6 | 73.9 | 74.4 | 850 |
| UCMCTrack | 64.0 | 75.6 | 73.9 | 980 |
| BoostTrack | 67.5 | 77.1 | 79.2 | 75 |
Evaluation on the second half of the MOT17 training set using YOLOX detections and FastReID embeddings. Pre-generated data available in releases. FPS measured on Intel i9-13900K.
| Tracker | C++ (FPS) | Python (FPS) | Speedup |
|---|---|---|---|
| ByteTrack | 1100 | 45 | 24x |
| OC-SORT | 850 | 32 | 27x |
| StrongSORT | 95 | 8 | 12x |
- C++17 compiler (GCC 9+, Clang 10+, MSVC 2019+)
- CMake 3.16+
- OpenCV 4.x
- Eigen3
git clone https://github.com/Geekgineer/motcpp.git
cd motcpp
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
sudo cmake --install buildfind_package(motcpp REQUIRED)
target_link_libraries(your_target PRIVATE motcpp::motcpp)#include <motcpp/trackers/bytetrack.hpp>
#include <opencv2/opencv.hpp>
int main() {
// Create tracker
motcpp::trackers::ByteTrack tracker;
cv::VideoCapture cap("video.mp4");
cv::Mat frame;
while (cap.read(frame)) {
// Your detector outputs: [x1, y1, x2, y2, confidence, class_id]
Eigen::MatrixXf detections = your_detector(frame);
// Update tracker
Eigen::MatrixXf tracks = tracker.update(detections, frame);
// tracks: [x1, y1, x2, y2, track_id, confidence, class_id, det_index]
for (int i = 0; i < tracks.rows(); ++i) {
int track_id = static_cast<int>(tracks(i, 4));
cv::Rect box(tracks(i, 0), tracks(i, 1),
tracks(i, 2) - tracks(i, 0),
tracks(i, 3) - tracks(i, 1));
cv::rectangle(frame, box, motcpp::BaseTracker::id_to_color(track_id), 2);
}
cv::imshow("Tracking", frame);
if (cv::waitKey(1) == 27) break;
}
return 0;
}| Tracker | Type | Speed | Paper |
|---|---|---|---|
| SORT | Motion | โกโกโกโกโก | Bewley et al., 2016 |
| ByteTrack | Motion | โกโกโกโกโก | Zhang et al., ECCV 2022 |
| OC-SORT | Motion | โกโกโกโก | Cao et al., CVPR 2023 |
| UCMCTrack | Motion | โกโกโกโก | Yi et al., AAAI 2024 |
| DeepOC-SORT | ReID | โกโกโก | Maggiolino et al., 2023 |
| StrongSORT | ReID | โกโก | Du et al., TMM 2023 |
| BoT-SORT | ReID | โกโก | Aharon et al., 2022 |
| BoostTrack | ReID | โกโก | Stanojevic et al., MVA 2024 |
| HybridSORT | ReID | โกโก | Yang et al., AAAI 2024 |
Need maximum speed? โ SORT, ByteTrack
General purpose? โ ByteTrack, OC-SORT
Heavy occlusions? โ OC-SORT, UCMCTrack
Moving camera? โ UCMCTrack, BoT-SORT
Re-identification? โ StrongSORT, BoostTrack
State-of-the-art? โ BoostTrack
| Resource | Description |
|---|---|
| ๐ Getting Started | Installation and first steps |
| ๐ API Reference | Complete API documentation |
| ๐ Tutorials | Step-by-step guides |
| ๐ก Examples | Code examples |
| ๐ฏ Tracker Guide | Choosing the right tracker |
| ๐๏ธ Architecture | System design |
| ๐ Benchmarking | Run your own benchmarks |
cmake -B build -DMOTCPP_BUILD_TESTS=ON
cmake --build build
cd build && ctest --output-on-failureWe welcome contributions! See CONTRIBUTING.md for guidelines.
If you use motcpp in your research, please cite:
@software{motcpp2026,
author = {motcpp contributors},
title = {motcpp: Modern C++ Multi-Object Tracking Library},
year = {2026},
url = {https://github.com/Geekgineer/motcpp},
license = {AGPL-3.0}
}This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
This project draws inspiration from and builds upon the excellent work of:
| Project | Description |
|---|---|
| BoxMOT | The original Python multi-object tracking library by Mikel Brostrรถm. Our C++ implementation follows similar architecture patterns and algorithm implementations. |
| Algorithm | Paper | Authors |
|---|---|---|
| SORT | Simple Online and Realtime Tracking | Bewley et al., 2016 |
| ByteTrack | ByteTrack: Multi-Object Tracking by Associating Every Detection Box | Zhang et al., ECCV 2022 |
| OC-SORT | Observation-Centric SORT | Cao et al., CVPR 2023 |
| StrongSORT | StrongSORT: Make DeepSORT Great Again | Du et al., TMM 2023 |
| BoT-SORT | BoT-SORT: Robust Associations Multi-Pedestrian Tracking | Aharon et al., 2022 |
| UCMCTrack | UCMCTrack: Multi-Object Tracking with Uniform Camera Motion Compensation | Yi et al., AAAI 2024 |
| BoostTrack | BoostTrack: Boosting the Similarity Measure and Detection Confidence | Stanojevic et al., MVA 2024 |
| HybridSORT | Hybrid-SORT: Weak Cues Matter for Online Multi-Object Tracking | Yang et al., AAAI 2024 |
| Resource | Source | Citation |
|---|---|---|
| MOT17 Dataset | MOTChallenge | Milan et al., 2016 |
| YOLOX Detections | YOLOX | Ge et al., 2021 |
| ReID Embeddings | FastReID | He et al., 2020 |
Made with โค๏ธ by the motcpp community



