Matlab Cascade Train for Bee Counting

I participate in agronomy, and the subject of my last school year is to estimate the number of bees in the photographs. I tried some methods (rebuilding, pattern matching with ciratefi algorithm or using imageJ), but nobody works fine.

I am starting to work with MATLAB, and I am wondering if it is possible to train a cascade detector and use the fonction vision.CascadeObjectDetector function to count bees in photographs.

Examples of two paintings:
http://img4.hostingpics.net/pics/473650DSC0648.jpg and
http://img4.hostingpics.net/pics/978154DSC0660.jpg

How many positive and negative samples do I need to use? Hog? Haar? LBP?

thanks for the help

+8
object matlab detection cascade matlab-cvst
source share
2 answers

It may work, but it will be difficult. From the images you provided, I think you may have a good chance of finding isolated bees, but it will be difficult to find those that are crowded together. In the latter case, it is difficult to see the outline of the shape of each bee, and some bees cover other bees. But you won’t know until you try. :)

Also, be aware that a cascading object detector does not handle rotation in the plane. This means that you will have to train several detectors for different bee orientations. You can use the trainCascadeObjectDetector function to train the detectors.

You will need at least several hundred positive samples of each orientation. You can use the Image Image Labeler application , which comes with the latest version of the Computer Vision System Toolbox for marking bees in images.

You will also need a lot of honeycomb images without any bees on it for use as negative images.

As for the functions, I would start with HOG or LBP, because they are much faster than Haar. If you get encouraging results, you can try Haar to see if you can improve your accuracy.

+2
source share

If you can shoot hives without bees in the same lighting conditions, it would be great! try and then subtract two images (in pixels) and see what you get. This difference image would be much easier to work with.

In addition, with regard to the training of the classifier: from viewing images, you will need the "rotationaly invant" classifier. This is a fancy way of saying that bees can be at different angles. Thus, you basically take a few dozen images of bees and rotate them randomly. This will give you several hundred positive examples. Then the samples of the place without bees, I think, a few dozen, too. Do not rotate them, as places without bees are not invariant with respect to rotation. Now prepare the classifier. I don’t think it’s important which one you use - just use the simplest one (like Viola-Jones).

So, to repeat: there are two main parts: 1) seeing whether the background can be subtracted 2) the training of your classifier.

Please tell me if this helps!

0
source share

All Articles