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.
- 🎯 10 State-of-the-Art Trackers — SORT, ByteTrack, OC-SORT, DeepOC-SORT, StrongSORT, BoT-SORT, BoostTrack, HybridSORT, UCMCTrack, OracleTrack
- ⚡ 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 |
| OracleTrack | Motion | ⚡⚡⚡⚡ | Kalman + CMC + Cascaded Association |
| 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, OracleTrack
General purpose? → ByteTrack, OC-SORT, OracleTrack
Heavy occlusions? → OC-SORT, UCMCTrack, OracleTrack
Moving camera? → UCMCTrack, BoT-SORT, OracleTrack
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



