yasenh / sort-cpp Goto Github PK
View Code? Open in Web Editor NEWC++ version of SORT: Simple online and realtime tracking of multiple objects in a video sequence
License: GNU General Public License v3.0
C++ version of SORT: Simple online and realtime tracking of multiple objects in a video sequence
License: GNU General Public License v3.0
@yasenh can this source code track objects having orientation ?? if not where can i add the orientation of the object parameters ??
Hi
Thanks for your great work. I've written python bindings and a package for SORT algorithm using this repository. Other python packages which I had found were implemented in python and performed slowly, so I decided to use C++ behind and wrote this module. It also can be installed via pip.
https://github.com/MrGolden1/sort-python
If you wish, include the link in your README.
Thank you!
It seems
Line 37 in 1dcafba
Reproduced on g++ 7.5.0, g++ 10.3.0, clang 11.0.0.
Sample leads to tracker.Run() infinity cycle:
#include <opencv2/core.hpp>
#include "tracker.h"
int main(int argc, const char *argv[]) {
Tracker tracker;
std::vector<std::vector<cv::Rect>> all_detections = {
{cv::Rect(15, 4, 12, 2)},
{cv::Rect(15, 4, 6, 2)},
{cv::Rect(15, 4, 2, 2)},
{cv::Rect(12, 5, 5, 2)},
};
for (auto det : all_detections) {
tracker.Run(det); // On the last `det` munkers algorithm stucks in infinity cycle.
}
}
Reason:
Kalman filter prediction hasn't zero bounds on width and height (in this code block problem in width, see logs below). So track object that is built from Kalman prediction can be with negative width/height.
Track area will be negative if one of the track's width/height is negative and other is positive. So it can be case (like in code block) when
formula in Tracker::CalculateIou
float union_area = det_area + trk_area - intersection_area;
equals zero and auto iou = intersection_area / union_area;
got zero devision which leads iou==(+/-)nan.
Some logs:
1)
Track::ConvertStateToBbox rect:[12 x 2 from (15, 4)]
Tracker::CalculateIou det_area:12 trk_area:24 intersection_area:12 iou:0.5
2)
Track::ConvertStateToBbox rect:[0 x 2 from (15, 4)]
Tracker::CalculateIou det_area:4 trk_area:0 intersection_area:0 iou:0
3)
Track::ConvertStateToBbox rect:[-5 x 2 from (14, 4)]
Tracker::CalculateIou det_area:10 trk_area:-10 intersection_area:0 iou:-nan << !!!!!
4)
Track::ConvertStateToBbox rect:[2 x 2 from (15, 4)]
Tracker::CalculateIou det_area:10 trk_area:4 intersection_area:2 iou:0.166667
Infinity cycle here because Munker's matrics have `-nan` from step 3.
Pull request with bugfix will be soon.
Hello @yasenh , it's a nice work, however i am bit optimistic about adding functionality to show trace lines for the tracked object, you can just look into this kalman_filter_multi_object_tracking SORT implementation which is in python and does pretty good job in tacking object along with the trace lines.
@yasenh thanks for wonderful source code , i had few quereis
Thanks in advance
'M_PI': undeclared identifier in kalman_filter.cpp(116,83)
deepsort
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.