How to detect birds (high-tech scarecrow) [closed]

asked 2014-04-11 04:08:10 -0600

schlimbo gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-08-29 16:58:44.321315

Comments

1

"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.

berak gravatar imageberak ( 2014-04-11 04:36:51 -0600 )edit
1

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!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-11 04:43:13 -0600 )edit

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?

schlimbo gravatar imageschlimbo ( 2014-04-11 05:21:08 -0600 )edit

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!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-11 06:15:14 -0600 )edit

isn't that what opencv_create_samples does? I was assuming that's what is stored in the vec files.

schlimbo gravatar imageschlimbo ( 2014-04-11 07:59:10 -0600 )edit
1

yep it does, but you can add the artificial rotations and deformations, which I would not do!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-11 08:11:24 -0600 )edit
1

aha. ok. I'll try that. Thanks.

schlimbo gravatar imageschlimbo ( 2014-04-11 09:01:09 -0600 )edit

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? :)

DD gravatar imageDD ( 2015-12-08 04:16:58 -0600 )edit