I am new to OpenCV (actually using the Emgu CV C # shell) and I am trying to detect some objects.
I am trying to determine if an object matches a predefined set of objects (which I will need to determine). The background is well lit and does not move. My objects that I start with are bottles and cans.
My current approach: Make absDiff with the previously made background image to separate the background. Then expand 4x to reduce light areas (in shortcuts). Then I make a binary threshold to get a great blog, and then find the outlines in this image. Then I take the largest contour and draw it, which becomes my shape, to either keep the accepted set, or compare with the accepted set.
I am currently using cvMatchShapes, but the double return value seems to vary widely. I guess this is because it does not account for the rotation.
Is this approach good? It does not work well for glass bottles, since the edges are hard to find ...
I read about hara classifiers, but thought it might be redundant for my task.
source share