Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Generic shape recognition is a harder task and probably needs some training. If your shape set is limited (like in your images), it is easier to write a special detection algorithm for every shape.

For example: - distinguish shapes with a hole (empty circle, triangle) from filled shapes (filled circle, cross) using findContours()

  • use houghCircles() on your contours to find out, if it's a circle. If it's not, it's a cross or a triangle

You can also play around with HuMoments()