The descriptor of each interest point is an array, so the euclidean norm is defined (sum of the squares of each element): so, if you have another interest point and you want to compare it to another one, you can get the difference between its descriptor and a reference descriptor one and then, on this difference, calculate the euclidean norm. This is a value that tells you how different (or similar) they are.
Code speaking:
-
private double euclideanDistance( Interest_Point target,
Interest_Point another_point) {
float[] targetDescriptor = target.getDescriptorOfTheInterestPoint();
float[] theOtherOneDescriptor = another_point
.getDescriptorOfTheInterestPoint();
double distance = 0;
for (int i = 0; i < 64; i++) {
distance += Math.pow(
targetDescriptor[i] - theOtherOneDescriptor[i], 2);
}
return Math.sqrt(distance);
}
You compare your interest point to all the ones you have in your target image, and if you find obtain a required likelihood you have the correspondence.
Repeat this for every point you have in an image, and in the end you can make an average of the matched interest points of your target image. Again, if you have more than a certain percentage of matching, you can say you found the target image in the image you are considering.
A prototype function could be:
private ArrayList<Interest_Point> imageToSearchInto;
private ArrayList<Interest_Point> matchingInterestPoints = new ArrayList<Interest_Point>();
//Array cointaining all the IP of the target image
private ArrayList<Interest_Point> InterestPointOfTheBanner;
public void findMeHere() {
Interest_Point target;
for (int i = 0; i < InterestPointOfTheBanner.size(); i++) {
target =
InterestPointOfTheBanner.get(i);
//Look for the best match in imageToSeachInto
Interest_Point best = getBest(target, imageToSearchInto);
if (euclideanDistance(target, best) < 0.7) {
// Found! Adding to matching IP
matchingInterestPoints.add(best);
// I remove the IP to the ones to be used for new matching
imageToSearchInto.remove(best);
}
}
}
// 10% of threshold
if (
InterestPointOfTheBanner.size()/matchingInterestPoints.size() > 0.1){
// Target image found!
}
}
Hope this helps