2

I have two similar images, one is the template and the other image is pictured through a camera (thus, subject to rotation and skew). I need to match the contour of the template image and the photographed image. Is the matchShape function of opencv sufficient? My concern is that if there are 2 circles on the image, they might have the same contour. Should I consider the position of the contours?

Thanks in advance

MiuMiu
  • 1,905
  • 2
  • 19
  • 28

1 Answers1

1

In most cases matchShapes() method should work, because it uses Hue moments which are invariant to scale, rotation and reflection (Except 7th).

On the other hand if you need something more specific, you should devise your own error minimization problem just like the ones used in deformable templates. Examples of using deformable templates can be found in my thesis.

Hakan Serce
  • 11,198
  • 3
  • 29
  • 48
  • thanks! I just like to ask if I have 2 circles (same size) on the image, will it detect the correct circle? – MiuMiu May 17 '12 at 23:58
  • If the position of the circle is important for you, you should check that seperately. matchShapes() should be invariant to the position of the circle. – Hakan Serce May 18 '12 at 00:09
  • do you know any algorithm to do that? I have to base the position on template image. thank you again for your reply – MiuMiu May 18 '12 at 02:41
  • Can you post a sample image, and template please. – Hakan Serce May 18 '12 at 09:51