Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

minMaxLoc, maxVal always is 1

$
0
0
Hi everyone When i use minMaxLoc, to find the best score of matchtemplating, in maxVal i have always value 1. My code: void MatchingMethod(int, void*) { Mat img_display; img.copyTo(img_display); int result_cols = img.cols - templ.cols + 1; int result_rows = img.rows - templ.rows + 1; result.create(result_rows, result_cols, CV_32F); matchTemplate(img_display, templ, result, CV_TM_SQDIFF); normalize(result, result, 0, 1, NORM_MINMAX, -1, Mat()); /// Localizing the best match with minMaxLoc double minVal; double maxVal; Point minLoc; Point maxLoc;Point matchLoc; minMaxLoc(result, &minVal, &maxVal, &minLoc, &maxLoc, Mat()); scores = maxVal; if (scores > 0.0) { printf("\nWynik:%\F", minVal); printf(" %\F", maxVal); printf(" %\F", minLoc); printf(" %\F", maxLoc); }; if someone can help me?

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>