Ask Your Question
-1

Is there a way to use templateMatch to return a boolean, and x,y coordinates of the match? (Python)

asked 2014-09-01 18:11:48 -0600

updated 2020-11-02 17:33:46 -0600

Is there a way to use templateMatch to return a boolean, and x,y coordinates of the match? I have been trying to read articles to understand the results from a template match (i.e. min_val, max_val, min_loc, max_loc), but almost all of them simply put a box around the match. I want to build a function to search for the match and then return true or false, and if true what are the x,y coordinates of match. Seems simple to me, but can't find info. Thank you!

edit retag flag offensive close merge delete

Comments

Who voted my question down almost instantly but didn't try to help answer it?

jrknox1977 gravatar imagejrknox1977 ( 2014-09-01 20:01:32 -0600 )edit

minMaxLoc will give you the position, and the minimal distance. threshold the distance, and you're done.

berak gravatar imageberak ( 2014-09-02 04:54:44 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-09-02 04:35:19 -0600

Here is a Nice Explanation for detecting multiple template occurrences in an Image.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-09-01 18:11:48 -0600

Seen: 888 times

Last updated: Sep 02 '14