Hello dear community,
I am trying to run a Haar classifier, but I am stuck already with creating enough sample images (FYI I am using git clone github.com/mrnugget/opencv-haar-classifier-training.git)
I follow the instructions as per www.trevorsherrard.com/Haar_training.html up until the command
$ perl bin/createsamples.pl ...
in my terminal but I do not get any samples. The command returns only multiple lines like the following (for each positive example):
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 3264 -h 2448 -img ./positive_images/IMG_0227.JPG -bg tmp -vec samples/IMG_0227.JPG.vec -num 69
Does anybody know what the problem could be? (please see below a detailed step-by-step description of what I did)
Thank you!
What I did, step by step (by default I am in the haar_classifier root dir):
(1) I created multiple positive examples by cropping the original large pictures with positive examples and reducing the pictures to the relevant area only, saved in folder "positive_images" (around 30)
(2) I created a random set of background examples and saved in folder "negative_images" (around 500)
(3) I created the lists of positive and negative examples with the terminal commands
$ find ./negative_images -iname "*.jpg" > negatives.txt
$ find ./positive_images -iname "*.jpg" > positives.txt
This command returns text files, which include only the names of the positive and negative files such as
"./positive_images/good01.jpg"
(4) I then run in my terminal
$ 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"
To my understanding, this command should create 1500 distorted images in my "samples" directory. However, nothing really happens apart from the output
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 3264 -h 2448 -img ./positive_images/IMG_0227.JPG -bg tmp -vec samples/IMG_0227.JPG.vec -num 69