Tag: 模板匹配

如何在从ORIGINAL-IMAGE中提取的SUB-IMAGE中执行模板匹配过程并在原始图像中显示结果

一整天我已经尝试了很多东西来获得子图像中的所有相关匹配(带有matchtemplate函数),这是我已经使用mousecallback函数从原始图像中提取的ROI。 所以我的代码在下面是匹配function ////Matching Function void CTemplate_MatchDlg::OnBnTemplatematch() { namedWindow(“reference”,CV_WINDOW_AUTOSIZE); while(true) { Mat ref = imread(“img.jpg”); // Original Image mod_ref = cvCreateMat(ref.rows,ref.cols,CV_32F);// resizing the image to fit in picture box resize(ref,mod_ref,Size(),0.5,0.5,CV_INTER_AREA); Mat tpl =imread(“Template.jpg”); // TEMPLATE IMAGE cvSetMouseCallback(“reference”,find_mouseHandler,0); Mat aim=roiImg1.clone(); // SUB_IMAGE FROM ORIGINALIMAGE // aim variable contains the ROI matrix // next, want to perform template […]