1 | initial version |
The problem with the tutorial is that it knows the object is going to be in the image. There are two issues.
normalize( result, result, 0, 1, NORM_MINMAX, -1, Mat() );
which means the smallest match (very low score) will still be normalized towards the 1 value.As you can see here:
/// Localizing the best match with minMaxLoc
double minVal; double maxVal; Point minLoc; Point maxLoc;
Point matchLoc;
minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat() );
Problem is that in your case, you will have to find a harsh threshold on the non-normalized match score map. If it does not meet the threshold, there will simply be no hit!
2 | No.2 Revision |
The problem with the tutorial is that it knows the object is going to be in the image. image, and it does not cope with the fact that there are possible no matches at all. There are two issues.main issues in this tutorial code if you want to apply it for your case.
normalize( result, result, 0, 1, NORM_MINMAX, -1, Mat() );
which means the smallest match (very low score) will still be normalized towards the 1 value.As you can see here:
/// Localizing the best match with minMaxLoc
double minVal; double maxVal; Point minLoc; Point maxLoc;
Point matchLoc;
minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat() );
Problem is that in your case, you will have to find a harsh threshold on the non-normalized match score map. If it does not meet the threshold, there will simply be no hit!