I am trying to train a cascade classifier to detect a paper (8.5"x11") on a window (real house windows). Basically, I am trying to measure the width and height of the windows based on the paper. Once I detected the paper, I can get the width and height of the window through simple ratio calculation (since paper is fixed size)
I tried using just plain paper with no luck. It could detect the paper but also some random objects. It wasn't too reliable and the training only took 31 minutes. Positive samples were generated from 15 different pictures of paper (cropped). Negative samples are 300x300 window images. Parameters: -numStages 1 -nsplits 2 -minHitRate 0.995 -maxFalseAlarmRate 0.9 -numPos 400 -numNeg 400 -w 62 -h 80
Now I am trying to detect same paper size but with printed object on it (to provide some patterns). Basically, I printed a big Android logo and tried to train the cascade classifier to detect it. Here's my parameters: -numStages 1 -nsplits 2 -minHitRate 0.995 -maxFalseAlarmRate 0.9 -numPos 890 -numNeg 890 -w 62 -h 80 (negative images are in 150x150 pixel resolution)
So I got better results than that of plain paper. I tried to input some of the positive samples (generated by opencv_createsamples) to the cascade classifier and it detects the paper (printed Android) with high accuracy. The problem occurs when I input a real image (picture of a window with the Android paper), the classifier does not detect the paper at all.
Take note that when I input the real image, I resize it to 150x150, so the object to detect (paper) becomes even smaller (around 31x40) and I tried to set the minimum size parameter (in detectMultiScale) to 31x40.
Also, when I try to increase the number of stages, it gives me a 'required leaf false alarm rate achieved' error no matter how much I experiment with -minHitRate and -MaxFalseAlarmRate parameters. Even with these two parameters are set to very low values (0.3 and 0.3 respectively).
Do you guys have any suggestions? What else should you think I try? I am thinking retraining the system with more complex pattern, would that be helpful? I just need some opinions because I have been training my classifier for 3 weeks with more than 50x attempts trying different parameters and image sizes. I am just tired and ran out of ideas to try...
Thanks in advance.