Ask Your Question

user.opencv's profile - activity

2014-05-24 01:26:16 -0600 commented question problem with cvMatchTemplate method

This is just an example for my purpose an not my final goal.I want generally to find a template in a source image and I'm not following face detection or anything like that.

2014-05-21 00:26:03 -0600 commented question problem with cvMatchTemplate method

thank you, but it is important for me that i don't want to cut my template from source. (my template could be a few defferenc with source)

2014-05-20 04:28:15 -0600 asked a question problem with cvMatchTemplate method

hi there, I'm new in openCV and want to using of cvMatchTemplate but the result of this method is not desirable. My program is:

IplImage *t = cvLoadImage("template.jpg",1);
IplImage *i = cvLoadImage("source.jpg",1);
IplImage *res = cvCreateImage(cvSize(i->width - t->width+1,i->height - t->height +1),IPL_DEPTH_32F, 1);
cvZero(res);
cvMatchTemplate(i, t, res, CV_TM_CCORR_NORMED);
CvPoint minloc, maxloc;
double minval, maxval;
cvMinMaxLoc(res,&minval,&maxval,&minloc,&maxloc,NULL);
cvRectangle(i, cvPoint(maxloc.x, maxloc.y), cvPoint(maxloc.x + 50, maxloc.y + 50), cvScalar(250,250,250), 2, 0, 0);
cvShowImage("Matched area",i);

but after running it the result image is:

image description

and my source and template images are:

image description image description

(in result image a bigger rectangle is matched with template...!!!).

Help me to use of template macthing in openCV, Special thanks to you.