Detect a specific shape using OpenCV

firewall picture firewall · Dec 9, 2012 · Viewed 16.9k times · Source

I'm still a beginner in OpenCV.

Currently, I'm trying to detect a specific shape as in the image in the link below using OpenCV.

enter image description here

I've read many blogs and articles about detecting shapes using OpenCV but I've not found anything related to what I'm working on.

Also, I can't use methods like cvHistogram, because I don't want to find matches in two almost identical pictures, but instead, I want to detect a specific shape, and not some geometric shapes like rectangles, circles, etc.

Do you know a way to do it?

Thank you in advance.

Answer

ArtemStorozhuk picture ArtemStorozhuk · Dec 9, 2012

It's hard to say how to detect this shape. You should specify some criterions about shape that you want to detect. For example in your case:

  1. should this always be inside another contour?
  2. should it has that big black blob?

And so on.

And after this it will be easier to find good detection algorithm.

By the way reading these docs will be useful:

  1. Finding contours in your image
  2. Structural Analysis and Shape Descriptors