Finding shapes in an image using opencv

后端 未结 2 1726
夕颜
夕颜 2020-12-15 01:27

I\'m trying to look for shapes in an image using OpenCV. I know the shapes I want to match (there are some shapes I don\'t know about, but I don\'t need to find them) and t

相关标签:
2条回答
  • 2020-12-15 02:02

    Have you try Chamfer Matching or contour matching (correspondence) using CCH as descriptor.

    Chamfer matching is using distance transform of target image and template contour. not exactly scale invariant but fast.

    The latter is rather slow, as the complexity is at least quadratic for bipartite matching problem. on the other hand, this method is invariant to scale, rotation, and probably local distortion (for approximate matching, which IMHO is good for the bad example above).

    0 讨论(0)
  • 2020-12-15 02:20

    As your shapes can vary in size and ratio, you should look at scaling invariant descriptors. A bunch of such descriptors would be perfect for your application.

    Process those descriptors on your test template and then use some kind of simple classification to extract them. It should give pretty good results with simple shapes as you show.

    I used Zernike and Hu moments in the past, the latter being the most famous. You can find an example of implementation here : http://www.lengrand.fr/2011/11/classification-hu-and-zernike-moments-matlab/.

    Another thing : Given your problem, you should look at OCR technologies (stands for optical character recognition : http://en.wikipedia.org/wiki/Optical_character_recognition ;)).

    Hope this helps a bit.

    Julien

    0 讨论(0)
提交回复
热议问题