How to detect birds (high-tech scarecrow) [closed]
I am trying to build a high-tech scarecrow using a opencv-bird-detector. Following the tutorial http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html I created 7000 positive samples (from 400 images) and 750 negatives. The resulting classifier detects mostly anything, from grass to blue skies. It even accepts the negative samples.
I wonder why this doesn't work at all. One thought I have is that maybe the positive images are too diverse, showing birds in trees, on the road, walking and flying. I used only 4 different kinds of birds (the ones I expect to eat my cherries). On the other hand that's what I understood the training is meant to handle.
I know I could use motion detection for a first approximation, but with winds etc. that doesn't seem sufficient.
Any idea?
"One thought I have is that maybe the positive images are too diverse, showing birds in trees, on the road, walking and flying" - yes, that's most likely the problem.
cascades are only good at detecting 1 shape in 1 pose.
I think for something diverse as birds, you will need a more diverse object detection framework, like the parts based modeling of Pedro Felzenswalb. His code can be downloaded here!
Ok thanks. One though I had was that maybe I just have a few classifiers, like one for flying birds and one for sitting birds. Probably I would need quite a few. There is one more question: opencv_createsamples accepts the flags -bgcolor and -bgthresh. The docu is a little sparse on those. Could I use them (and if so how) to "erase" green-ish things on the images and so improve the results?
I would not go for the transformation approach but rather use real time examples. Using a file with the location of the items in each positive image, will get you way better results! If the greenish things are random; they will be smoothed out the model!
isn't that what opencv_create_samples does? I was assuming that's what is stored in the vec files.
yep it does, but you can add the artificial rotations and deformations, which I would not do!
aha. ok. I'll try that. Thanks.
Hi schlimbo. Had any luck with the bird detection? I am doing research on generating my own haar classifier for birds, maybe you want to make yours opensource? :)