# On score metrics for keypoint-descriptors

I am matching a lot of subwindows from a scene image to a model image with a Bruteforce Matcher and hamming distance. I want to find in which subwindow there is the highest probability that the object from the model image is present, and as a bonus I would like to know if nothing is found. (There are some reasons why I am sub windowing the scene, this is related to the fact there are often multiple possible matches and worst, multiple possible partial matches that must be rejected)

So I prune the matches result with a simple threshold, then I compute the homography of each subwindow with findHomography with RANSAC. This function has an optional output mask, let's call it the "homography_mask". Here is how it works.

Right now, I have two score metrics which each give me somewhat good results but I have the feeling that they could be improved. (in pseudocode)

 1. score = countNonZero(homography_mask); // The absolute number of inliers as computed by the homography