1 | initial version |
imho, you're calculating something different, than compare() / countNonzero().
try:
uchar s1 = mat1.at<uchar>(y,x);
uchar s2 = mat2.at<uchar>(y,x);
score += (s1 == s2);
2 | No.2 Revision |
imho, you're calculating something different, than compare() / countNonzero().
try:
uchar s1 = mat1.at<uchar>(y,x);
uchar s2 = mat2.at<uchar>(y,x);
score += (s1 == s2);
can you explain, how you arrived at:
score += (s1.val[0]/255)*(s2.val[0]/255);
?