
So I have been trying to learn how to build Haarcascade files. There really is zero documentation online for this process, so its hard to tell if you are doing it right or wrong. This is where I am so far:
step 1:
You need to collect a bunch of negative images. Images that do not have the object that you are trying to track. You need to create a .dat file; a file that is just a list of all the images in a directory.
step 2:
There are a couple of techniques for step two. Opencv can generate positive samples from one image of the object you want to track, this is not the best technique but does work.
when you do this you get a bunch of images that look something like this.


The other approach is to have a series of positive images that are cropped. I think that this is the more accurate approach. I needed figure out how the openCv executable was building these samples. After figuring this out I build an app that loads a series of images that you can click all the objects in the image. You can also use a video camera to add more images and save out images. Here is a demo of the app working.
step 3:
Now you just need to train. Running the opencv haar training executable you will generate an .xml file to load in a haarTracking app. I am still learning all the settings for this step. The perfect tweak of the setting will give you the best result for what you want to track.
Here is what I have been able to get so far. The results are not to bad but I need to learn some more. Any help would be great.
May 8th, 2009 at 10:27 am
Hi Todd
I am a student at Westminster University, London, and am currently working on a project where I am trying to use opencv’s haartraining to recognise hand gestures. I have positive and negative samples, but don’t really know where to go from here…or how to do it?
I am trying to follow a few guides, but they make no sense to me as I am new to opencv/openframeworks/c++…
Also, my haartraining.exe application quits as soon as I open it…is this normal?
If you have any advice I would appreciate this greatly.
Kind Regards
Mark Steedman
May 27th, 2009 at 3:53 am
Dude, great stuff.
Any chance that you could give me that app you built for loading the positives images and then outlining them?
Pretty please :D
Jon
June 16th, 2009 at 9:02 pm
please I’m student from Peru , and I need to learn to use it, i dont understand how to have an empty project, to use and inicializate whit my own samples.
thanks
my email is natalybsa@gmail.com
natalybsa@hotmail.com
September 28th, 2009 at 1:21 pm
Hi, can you point me out where can i get those negative samples ?
Thank you.
October 23rd, 2009 at 1:29 pm
Hi
I’m at University of Zaragoza, Spain. I’m working on an app that counts the number of boxes in a small warehouse. For this project I’m using OpenCV, and I’m having some problems with the images.
I would be very grateful if you could send me your fabulous app to use it into my project and to make my life easier.
Thanks for all
February 3rd, 2010 at 11:34 am
Hello,
I work with OpenCV, but for the location of objects I use objectmarker but it’s not very practical. What software do you use in your video to retrieve objects?
Thanks for all
February 14th, 2010 at 6:30 pm
Hi,
Todd I was wondering how many positive vs negative samples you used to build this example?
Thanks a lot for your help.
Kind regards,
Wim
April 1st, 2010 at 12:33 pm
Well done.
May 19th, 2010 at 4:17 am
Hello,
I work with OpenCV, but for the location of objects I use objectmarker but it’s not very practical. What software do you use in your video to retrieve objects?
Thanks for all