Ask Your Question

Revision history [back]

How to train a cascade classifier for a a fixed image (logo)

I have attempted to train a haar cascade classifier several times with varying, bad results. I created several positive sample images of a card with the logo printed on it. I added several block-like features to the card to make it easier to recognize. I downloaded a set of negative sample images. I generated vectors and samples with commands I pieced together from several websites, mainly this one: http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html I am using OpenCV 3.0 rc1

I tried a range of stages, from 5 to 20. I have tried from 100 to 1500 positive samples and from 500 to 2000 negative samples. I have tried window sizes from 20x20 to 48x48 (the card I want to detect is square).

None of the cascade files have been any good. Some won't detect anything. Some detect almost everything... but not the card! I've checked over everything I can think of - like did I actually get the positive samples in the right directory...

I'm at a loss. Are there some common rookie mistakes I should double check? Has anyone had bad results like this? Are bad cascade files common? My target seems much easier to classify than most problems since it is a fixed image. Does that change the problem somehow in a way I do not grasp?