eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

Question: Generate new Object Tracker #112

Closed valepu closed 9 years ago

valepu commented 9 years ago

Hello, I hope i'm not asking a dumb question, but i'd like to know how to generate training data in order to make a new tracker. I have no experience with computer vision but i have no fear to get my hands dirty, though it is not clear to me what i have to use to generate training data (if it's possible at the moment, that is). I have to do something similar to issue #109 my logos are monochromatic images on white paper (the concept is not that different than QR codes, just that they are made of one single color), from what i have understood i have to generate data for an implementation of the viola-jones algorithm (seems to be the right choice for my task, even though it's specialized in face detection) and then import it with the script contained in opencv_haarcascade_converter.html, is that right?

I can understand that it's not your responsability to provide a guide for that but, If possible, it would be nice to have a very brief guide or even just some suggestions on what software to use to do that would be apprecciated (i just need to be pointed in the right direction)

valepu commented 9 years ago

Maybe this will be of help if someone else wants to create new object trackers: I have managed to generate data for tracking.js using gulp-convert-tjs. 1) Downloaded OpenCV and followed the instructions from this video: https://www.youtube.com/watch?v=WEzm7L5zoZE (used -featureType Haar instead of LBP to create a cascade.xml file). As i said in my first post, i have never used OpenCV so i didn't tweak any of the settings nor i used a good training sample, i was just trying to get to the end. 2) Installed gulp and gulp-convert-tjs through npm in a empty folder. This was very time and energy consuming and took me half a day, i had node and Visual Studio 2010 already but i had to install (the main problem was that visual studio errors weren't very clear and it took me a lot of googling to discover what was causing them)

3) Followed the instructions from https://github.com/cirocosta/gulp-converter-tjs to create a gulp task

eduardolundgren commented 9 years ago

That sounds awesome @valepu.

Do you happen to have screenshots of tracking.js detecting your custom object? If so, post here please.

Would be good to do an automatic conversion task, e.g. having a folder inside tracking.js project that we drop HAAR XML files and the custom task based on gulp-convert-tjs to convert them automatically to the flattened array.

/cc @cirocosta

valepu commented 9 years ago

Sadly the training set was very bad and there were many false positives, and now the part of the project I wanted to use tracking.js on was put on hold because we don't have much time, but i'm looking forward into using your awesome library in another project sooner or later.

cirocosta commented 9 years ago

Thanks for all your effort @valepu :+1: :+1: !

I was thinking here, maybe it'd be of great benefit to test the produced training data against both tracking.js and pure opencv trackers persuing a great end for #98 . I do already have opencv setten up, having some time i could go for it. What do you think @eduardolundgren ? (Also, what about closing this issue and going back to #98 ?)

eduardolundgren commented 9 years ago

SGTM. Closing this one in favor of #98. Thank you.