Ask Your Question

Revision history [back]

Simple logo haar file I created causes tons of false positives.

So I took the facedetect.py and made a custom haar file to detect a simple logo. For the sake of simplicity it's something like the gap logo on the left here: http://adweek.blogs.com/.a/6a00d8341c51c053ef0133f4e33f2a970b-pi

I cropped an image to the exact bounds of the logo (the blue box on the left) and generated samples from it:

opencv_createsamples -img gaplogo.png -num 1000 -vec hb.vec #(it actually wouldn't let me do more than 1000)

Then I downloaded 2600 random images. Just everything under the sun. Buildings, people, desktop images (I tried this just because it's just randomly triggering on the desktop), landscapes, plants. You name it, I downloaded it. From what I read it's just supposed to be images that do not contain thing.

Then I build my haar file

opencv_traincascade -data data -vec hb.vec -bg neg.txt -numPos 999 -numNeg 2500 -numStages 10

It actually only makes it through like 3 stages before it declares that's it and generates the haar file.

In stead of a webcam, I feed in a stream of my desktop and it tries to draw boxes on nothing. Ideally, when I bring up the logo, and only the logo, it should draw a box around it. Instead it spazes out on random stuff. I thought something simple like the logo should have been a slam dunk for easy identification.