Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Recognize basic shapes in binarized image

How can I recognize some basic (usually rotated) shapes:

  • circle,
  • "empty" circle,
  • cross,
  • empty triangle,

using OpenCV? What's the most straightforward way? It would be nice if the user could "define" his own shapes somehow (load a template image, possibly).

I'd like to map each recognized shape to its type (circle, triangle etc.) and a position of its center. (And its rotation if possible).

For circles HoughCircles could be used (there's no rotation in this case, too). But what about the others? Template matching doesn't support rotation and scaling, right?...

Here's the input:

empty triangle, empty circle, circles

empty triangle, empty circle, cross