java - Calculate percentage similarity of two images using OpenCV -


i able find matching features using bewlow shown code. want calculate percentage similarity between 2 images. new opencv. kind of highly appreciated.

    featuredetector detector = featuredetector.create(featuredetector.orb);     descriptorextractor extractor = descriptorextractor             .create(descriptorextractor.orb);      detector.detect(image1, keypoints1);     detector.detect(image2, keypoints2);      extractor.compute(image1, keypoints1, descriptors1);     extractor.compute(image2, keypoints2, descriptors2);      descriptormatcher matcher = descriptormatcher             .create(descriptormatcher.bruteforce_hamming);      matofdmatch matches = new matofdmatch();     matcher.match(descriptors1, descriptors2, matches); 

is there other library available serving same purpose?

i don't think can compute percentage per se using feature points. can compute "score of similarity".

first of all, want filter out bad matches have, in way (i use homography transformation geometrically validate matches). then, can establish own way of computing "score of similarity".

for instance, can sum hamming distances between matches have. , use position of feature points: suppose feature point ai on image a has correspondence bi on image b. coordinates of ai (xa, ya) , of bi (xb, yb). images similar, possibly want (xa, ya) close possible (xb, yb). score like:

score = hammingdist / distancebetween(point(xa, ya), point(xb, yb)) 

and of course, might want put more weight on hammingdist or on distancebetween; need experiment.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -