Tag: matchtemplate

matchTemplate opencv无法正常工作,如opencv文档所示

我正在努力解决这个问题,因为在我从相机拍摄的图像中,我需要找到一些模式的存在和位置。 为此,我发现使用matchTemplate方法。我使用了opencv样本中使用的图像并编写了代码但结果却不同。 http://opencv.itseez.com/doc/tutorials/imgproc/histograms/template_matching/template_matching.html 这是告诉我们matchTemplate的链接。 当我实现它时,它显示了结果: – 我的代码如下: – -(void)matchPatchNet { IplImage *res; CvPoint minloc, maxloc; double minval, maxval; int img_width, img_height; int tpl_width, tpl_height; int res_width, res_height; NSString *pathPatron = [[NSBundle mainBundle] pathForResource:@”timage” ofType:@”jpg”]; UIImage *tim = [UIImage imageWithContentsOfFile:pathPatron]; NSString *pathPatron2 = [[NSBundle mainBundle] pathForResource:@”simage” ofType:@”jpg”]; UIImage *tim2 = [UIImage imageWithContentsOfFile:pathPatron2]; IplImage *img = [self […]