gpu::matchTemplate returns inconsistent result with cv::matchTemplate (Bug #1341)
Description
I found two sets of images that cause gnu::matchTemplate and cv::matchTemplate return different results using CV_TM_CCOEFF_NORMED. The GPU results are even not normalized correctly.
gpu::matchTemplate(gSource,gTarget,gResult,CV_TM_CCOEFF_NORMED);
gpu::minMaxLoc(gResult, &min, &max, &min_loc, &max_loc);
cout << "gpu min: " << min << ", max: " << max << endl;
cout << "gpu min location: " << min_loc.x << "," << min_loc.y
<< ", max location: " << max_loc.x << "," << max_loc.y << endl;
matchTemplate(source,target,result,CV_TM_CCOEFF_NORMED);
minMaxLoc(result, &min, &max, &min_loc, &max_loc);
cout << "cpu min: " << min << ", max: " << max << endl;
cout << "cpu min location: " << min_loc.x << "," << min_loc.y
<< ", max location: " << max_loc.x << "," << max_loc.y << endl;
OUTPUT:
gpu min: -0.000928892, max: 4.89271
gpu min location: 0,0, max location: 2,4
cpu min: 0, max: 0.0919901
cpu min location: 0,0, max location: 4,0
Associated revisions
fixed bug in gpu::matchTemplate (added normalization routine to make the GPU version consistent with the CPU one), added test cases from the ticket #1341
Merge pull request #1341 from roynos:master
History
Updated by Anatoly Baksheev over 13 years ago
- Status deleted (
Open)
Updated by Anonymous over 13 years ago
Fixed.
Updated by Anonymous over 13 years ago
- Status set to Done
- (deleted custom field) set to fixed
Updated by Andrey Kamaev almost 13 years ago
- Target version set to 2.4.0