Ask Your Question

Image Matching always returns a location

asked 2013-08-19 20:40:43 -0600

Aphelion gravatar image

updated 2013-08-21 02:47:45 -0600

Why does image matching always return a found match location? Shouldn't just return 0,0 if the image isn't found?

edit retag flag offensive close merge delete


What did you call "image matching"? matchTemplate? DescriptorMatcher (FLANN, BF)?

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2013-08-19 21:48:57 -0600 )edit

Just a remark. In the future, try using tags without hashtags to it. It creates unneccesary doubles in the tags list, which makes it harder to perform good filtering on this forum. Thanks in advance! I have adapted your tags for this topic.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-21 02:50:49 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-08-21 17:44:30 -0600

matchTemplate isn't returning a result each time. It computes the overlapping of the template to the image, with the specified method. Therefore, there is always a results (for all pixels, the square difference, or the correlation, ...). When you use MinMaxLocation to find the "most probable position of the template on the image", I insist on the "most probable", you have a score, that you can threshold if it's too low. It's up to you and depend on your context.

edit flag offensive delete link more

Question Tools


Asked: 2013-08-19 20:40:43 -0600

Seen: 317 times

Last updated: Aug 21 '13