When comparing 2 images via feature extraction
, how do you compare keypoint
distances so to disregard those that are obviously incorrect?
I've found when comparing similar images against each other, most of the time it can fairly accurate, but other times it can throws matches that are completely separate.
So I'm after a way of looking at the 2 sets of keypoints
from both images and determining whether the matched keypoints
are relatively in the same locations on both. As in it knows that keypoints
1, 2, and 3 are so far apart on image 1, so the corresponding keypoints matched on image 2 should be of a fairly similar distance away from each other again.
I've used RANSAC
and minimum distance
checks in the past but only to some effect, they don't seem to be as thorough as I'm after.
(Using ORB
and BruteForce
)
EDIT
Changed "x, y, and z" to "1, 2, and 3"
EDIT 2 -- I'll try to explain further with quick Paint made examples:
Say I have this as my image:
And I give it this image to compare against:
Its a cropped and squashed version of the original, but obviously similar.
Now, say you ran it through feature detection
and it came back with these results for the keypoints
for the two images:
The keypoints
on both images are in roughly the same areas, and proportionately the same distance away from each other. Take the keypoint
I've circled, lets call it "Image 1 Keypoint 1".
We can see that there are 5 keypoints
around it. Its these distances between them and "Image 1 Keypoint 1" that I want to obtain so to compare them against "Image 2 Keypoint 1" and its 5 surround keypoints
in the same area (see below) so as to not just compare a keypoint
to another keypoint
, but to compare "known shapes" based off of the locations of the keypoints
.
--
Does that make sense?