0

I have two images a.jpg(src 1000*1000) and b.jpg(tpl 100*100).

Mat a=imread("a.jpg");//1000*1000
Mat b=imread("b.jpg");//100*100
...
double minVal; double maxVal; 
...
matchTemplate(a, b, result, 0 );
minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat());

printf("minVal=%f \n maxVal=%f \n", minVal,maxVal);

How to get the best matching(or adjustments),someone can help me,thanks :)

Candy
  • 65
  • 4
  • At a first glance i would say your code is correct, so: What is not working? What is your expected output? What do you get? – Mailerdaimon Jan 19 '15 at 07:13
  • Can you posr your sample template and src please? – Micka Jan 19 '15 at 07:32
  • I want judgement matching is seccuss,ture or false. What would you suggest ? – Candy Jan 19 '15 at 07:35
  • @Micka My code is working fine, i want to know how to judgement matching is seccuss of both images.:) – Candy Jan 19 '15 at 07:48
  • Seems similar question: http://stackoverflow.com/questions/24715830/success-of-template-matching-with-opencv?rq=1 – Andrey Smorodov Jan 19 '15 at 08:13
  • @AndreySmorodov :),It's great,I love you so much and more – Candy Jan 19 '15 at 08:20
  • in `result` there is a value for each position of your source image. The values tell you how good the template is represented int hat position! So the minVal or maxVal (depending on the comparisionmethod you used) tells you how good the best found value is and the position is minLoc or maxLoc ;) – Micka Jan 19 '15 at 09:58
  • @Micka Thanks for your advise.I have understood your explanation.:) – Candy Jan 20 '15 at 01:59

0 Answers0