First time here? Check out the FAQ!

Ask Your Question
0

Need clarification on matchTemplate

asked Nov 12 '12

unxnut gravatar image

updated Nov 12 '12

I am working with the matchTemplate function to locate the template in an image. I have gone over the tutorial and the documentation on the six different methods to do the job. I have started to use TM_COEFF_NORMED for my application but it seems to give me a result that is slightly displaced. I have checked my code over and over again but unable to find the cause for displacement.

The relevant URLs are: - http://docs.opencv.org/modules/imgproc/doc/object_detection.html?highlight=best%20match - http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html

Another question that comes to my mind is the circumstances in which the different methods may be more applicable. In particular, I'm interested in finding out when I should use TM_COEFF_NORMED vs TM_CORR_NORMED. I can see the mathematical formulas but am looking for guidance from someone experience on when I should be using a particular method.

I'll certainly appreciate any help I can get here.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Oct 18 '13

pklab gravatar image

Looking at math formulas the TM_COEFF scales the operand with respective average than result should be less sensible (or invariant) to all linear illumination changes.

Preview: (hide)

Question Tools

Stats

Asked: Nov 12 '12

Seen: 548 times

Last updated: Oct 18 '13