define match method for match Template

asked 2013-09-30 05:50:23 -0600

grobian gravatar image

Hello,

I am trying to run the match Template as described in this tutorial:

http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html

Maybe a simple question: I run the script in a terminal (Ubuntu): ./faceDetect Template_Matching_Original_Image.jpg Template_Matching_Template_Image.jpg

I would like to know where I can define the matching method? Currently, the match_methode variable is always 0(?)

Thanks! Grobian

edit retag flag offensive close merge delete

Comments

in that demo, you're supposed to change it with the trackbar, no ?

berak gravatar imageberak ( 2013-09-30 06:00:23 -0600 )edit

If I understand it correctely I have to declare the method...(?) In the description I found: Item 8 in the tutorial. "the arguments are naturally the input image I, the template T, the result R and the match_method (given by the Trackbar)"

Actually, I am not sure what I have to do..... Cheers, Grobian

grobian gravatar imagegrobian ( 2013-09-30 06:50:25 -0600 )edit

Hi again: in the description I found: Perform a template matching procedure by using the OpenCV function matchTemplate with any of the 6 matching methods described before. The user can choose the method by entering its selection in the Trackbar.

grobian gravatar imagegrobian ( 2013-09-30 07:02:49 -0600 )edit

One solution: I can change the value match_method directely in the code

grobian gravatar imagegrobian ( 2013-09-30 08:39:10 -0600 )edit

yes, ofc. you can. understand, that it's just a demo, a sample. you'll write your own code in the end ;)

berak gravatar imageberak ( 2013-09-30 09:09:57 -0600 )edit