14

I am struggling to create a custom haar classifier. I have found a couple tutorials on the web, but they do not specify which version of opencv they are using. What I need is a very concise and simplified example of the steps that are required, along with a simple dataset of images. I also need to know the opencv version and the OS platform so I can get it running. I have tried a matrix of opencv versions on both windows and linux and I have run into memory error after memory error. I would like to start with a known good set of data and simple commands before expanding it to fit my problem.

Thanks for your help, Chris

2
  • By Haar Classifier, you mean Boosting + Haar Wavelet like the face detection sample in OpenCV?
    – grapeot
    Jan 23, 2012 at 4:21
  • Maybe I know even less about this than I thought, my objective is to get OpenCV to detect the presence of objects that I specify. I assumed they way to do this would be to create a classifier with my object. Am I way off base?
    – CLJ
    Jan 23, 2012 at 4:25

1 Answer 1

13

OpenCV provides two utility commands createsamples.exe and haartraining.exe, which can generate xml files used by Haar Classifiers. That is, with the xml file outputted from haartraining.exe, you can directly use the face detection sample with your xml file to detect any customized objects.

About the detailed procedures to use the commands, you may consult Page 513-516 in the book "Learning OpenCV", or this tutorial.

About the internal mechanism of how the classifier works, you may consult the paper "Rapid Object Detection using a Boosted Cascade of Simple Features", which has been cited 5500+ times.

4
  • Thanks for confirming that I am on the right track, but I am really wondering if someone could post the commands and args in order and with accompanying images. That would be helpful!
    – CLJ
    Jan 23, 2012 at 6:39
  • 2
    Please check the tutorial I provided, whose link is again posted here. You'll find all the sample images (including positive/negative samples), command usage, and sample command in it. Hope this is helpful.
    – grapeot
    Jan 23, 2012 at 6:58
  • 1
    I did not realize the sample images were included. My apologies. I will check that out and report back.
    – CLJ
    Jan 23, 2012 at 7:17
  • Good advice, grapeot! I used the info from the book and I was finally able to get it to work. Thanks!
    – CLJ
    Jan 24, 2012 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.