Help for haar cascade

  • i use a translator

Hello, I am a beginner on openmv and I want to create a haar cascade

Can you tell me step by step instructions to follow

Best regards



  1. Follow OpenCV tutorials to train a haar cascade:

  • Note you have to use -baseFormatSave to save the cascade in the old format
  1. Convert xml to binary using the converter script:
python2 my_cascade.xml
  1. Copy my_cascade.cascade to camera storage (flash or SD) and run the example script.

Sorry for the late reply,

I tried your code but this line does not work. There is nothing in my samples folder

 perl bin/ positives.txt negatives.txt samples 1500\
   "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1\
   -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"

So i try with this code Make your own Haar Cascade on Windows | Quick & Simple | Face Detection - YouTube

it works with his photos.

Now i try with my pictures (ball) for positive img and i let the same negative img it not work

Have an idea why the camera does not detect them ?


If it’s not detecting the object, try a higher threshold and/or lower scale.