Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Find polygon in image (rotation-invariant)

Hallo,

So in an application I'm writing I have to detect polygons in a scene. The polygons are the contours of some objects (I simply illuminate my objects using a backlight), such that the object is black and the background is grey.

There's always only one object present in each image at a time and I know what polygon I should look for (All points of the polygon and therefore its edges are given)

What I don't know is firstly the location of the object in the image (e.g. its contour) and the rotation of the object.

Is there any way to detect this with opencv. What I tried so far is using some of the FeatureDetectors. The do not seem to work properly with my grayscale images since they don't detect so much interesting features, probably because my images are almost binary.

I'd love to simply use a canny filter on the image to get all the edges and match those with my polygon, but I don't really know how to do this.

Do you have any suggestions?