justadudewhohacks / opencv4nodejs

Nodejs bindings to OpenCV 3 and OpenCV 4
MIT License
4.97k stars 828 forks source link

Creating custom tracking algorithm #755

Open mywebstudio opened 4 years ago

mywebstudio commented 4 years ago

Hello! I tested all variants of the available trackers, they work with varying success in my particular project. I thought that if i customize it, the accuracy of the application will increase. I need to take into account a number of physical features of the nature of the movement. How can i make changes to the tracking algorithm? What are the options? Where can I find the required source files? I would like to see how the existing algorithms are implemented in order to get in the know and think about what can be changed in them But I can't find their source. I think it will potentially relate to all other functions, if someone wants to delve into them, a similar question may arise, especially who do not understand how this package was created.

mywebstudio commented 4 years ago

I managed to find something about my question here (tutorial-building-native-c-modules-for-node-js-using-nan). If I understand correctly, there are two options. I could fork opencv to make my changes to the algorithm and then create a node module using nan. Or perhaps I can do the same at the stage of rewriting the logic of the C ++ module into javascript?

piercus commented 4 years ago

Hi @mywebstudio,

There is a documentation of the parameters here

If you have doubts about the documentation completeness, for full list of params, you will need to dig in the cc code. The list of Tracker available in opencv4nodejs is in cc/tracking/tracking.cc.

If you want to add a tracker or add more parameters not exposed currently, you can check this commit where CSRT and MOSSE trackers integration were implemented https://github.com/justadudewhohacks/opencv4nodejs/commit/a940aa38765c10e130523373448af435c9906248

Tracking is a whole topic and there are big chances that no algorithm will work without any training.

You could also use this npm lib for tracking quality measurement https://www.npmjs.com/package/object-tracking-measure

From my experience, best tracking algorithm are now done using reidentification + object-detection neural-networks, this field is moving fast and person-reid has changed drastically since 2017 (see https://paperswithcode.com/sota/person-re-identification-on-market-1501)

If you want more detailed help, you can contact me in PM.