Monday, October 4, 2010

Haar Classifier Training Program

If you haven't used Processing to power through some small application that you need, I highly recommend it. (I just now remembered I still haven't posted about my poster in the conference, and given that it's officially published, I can officially talk about at least the extent to what we've done so far. Next post will be on that.) In any case, as part of the research, we're now switching to an OpenCV implementation, which means training a Haar Classifier. Now this is a task that is...a pain. It involves ideally thousands of images, and if you want the best accuracy, you should hand-annotate where your object is in the images.

To avoid going crazy and needing to destroy everything in the lab, I wrote a short app in processing to create the Haar file. I'll probably post a link to the code after I've completed the training on our images and verified that it doesn't start eating memory like no-one's business for large samples, since I had tried so very hard to avoid writing this app myself. Still, using Processing, it took all of 30 minutes to produce something that will be useful. I could've spent more time with the interface, and if I decide to release it, I very well may modify the code to have a nicer I/F and support multiple occurrences in the same image, but for now, this little app is sufficient for my purposes.

For the record, there's something utterly satisfying about completing a program in under an hour. :)

No comments:

Post a Comment