Advice on Haar/LBP approach

asked 2016-11-09 14:46:28 -0500

Poehe gravatar image

updated 2016-11-10 01:45:30 -0500

Hi everybody, I'm new to Haar/LBP classifiers and hoping someone can give me advice for a small project I'm working on. I have been reading a lot on this forum and trained a number of classifiers, but the results are not satisfactory with a lot of false positives. I would greatly appreciate any comments that could give me some guidance in selecting the best approach to reach my goal. Also, I hope others can benefit from my question too!

Goal: I would like my HAAR/LBP classifier to detect which age-rating a movie has by looking for the age-rating logo: for example, see the '16' logo on this cover. (if somehow this is not a good idea with HAAR/LBP, please let me know :)). For this question, let's only focus on finding age-rating 16. I tried three alternative approaches until now.

First approach

Positive image: I found a .PNG file which contains the exact logo that also appears on the cover.

Negative images: I downloaded thousands of plant and animal pictures from I cat them into the file negatives.dat

Creating positive training samples: I used the following command to superimpose my positive image onto random negatives: opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 24 -h 20 -img ./Positive_Images/6roodvec368.png -bg negatives.dat -info ./samples/6roodvec368.png/info.dat -num 2000

Create .vec: opencv_createsamples -info /samples/6roodvec368.png/info.dat -num 2000 -w 24 -h 20 -vec positives.vec

Training the classifier: opencv_traincascade -data data -vec positives.vec -bg negatives.dat -numPos 1800 -numNeg 3000 -numStages 20 -w 24 -h 20

Second approach: Identical to the first, except I cropped about ten age-rating 16 - logo's from actual movie cover pics (as opposed to using that 1 PNG-file as my sole positive image). Then I wrote a script that grabs each of these logo's and with opencv_createsamples superimposes them on 500 random negatives to create 5000 positive training images.

Third approach:

Positive images: Downloaded about 90 movie covers with age rating 16, then with opencv_annotations I indicated the ROI in each image, resulting in the file annotations.txt

Negatives images: I use about 400 plant/animal images I downloaded earlier from image-net. Also, I cropped the 90 movie covers to remove the bottom part that contains the age rating and added those to the negatives. Catted everything to negatives.dat

Create .Vec: opencv_createsamples -info annotations.txt -num 86 -w 50 -h 50 -vec positives.vec

Train Cascade: opencv_traincascade -data Classifiers/tmp -vec positives.vec -bg negatives.dat -numPos 80 -numNeg 450 -numStages 10 -w 50 -h 50

The results until now, for all approaches, are not satisfactory with a lot of false positives when I feed unseen 16+ rated movie covers to my classifier. I also trained with different numbers of positives and negatives (though pos 1500 neg 3000 has been my maximum). I would appreciate it if someone could let me ... (more)

edit retag flag offensive close merge delete