delmottea / libCMT

c++ port of the python code from https://github.com/gnebehay/CMT
BSD 3-Clause "New" or "Revised" License
67 stars 45 forks source link

Bug in the tracking function #8

Closed boris-il-forte closed 9 years ago

boris-il-forte commented 9 years ago

Hi, there is a bug in you're implementation (it seems that is not in the python implementation). when you track the points you add also the old ones. You should fix that this way:

instead of:

if (status[i]) //TODO error p.first.pt = nextPts[i]; keypointsTracked.push_back(p); //This line can be different in my implementation

you should write:

if (status[i]) { p.first.pt = nextPts[i]; keypointsTracked.push_back(p); }

unfortunatly, I can't provide you a pull request, because I've done major changes in my code, and now is incopatible with yours....

with that fix, the false positive rate goes down considerably, in particular when the object or the camera are in motion and the object goes out of view.

delmottea commented 9 years ago

ok, thanks. I've commited with the correction