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


Funky

Hi,

  1. Follow OpenCV tutorials to train a haar cascade:

https://docs.opencv.org/3.3.0/dc/d88/tutorial_traincascade.html

https://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html

  • Note you have to use -baseFormatSave to save the cascade in the old format
  1. Convert xml to binary using the converter script:
python2 cascade_convert.py 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/createsamples.pl 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 ?

Hi,

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