Ask Your Question
0

How can I use keypoints, descriptors and/or matches to compute similarity scores between images?

asked 2013-04-18 17:06:05 -0500

NJW gravatar image

Hi all, So far I have been able to implement a SURF descriptor extractor and a brute force matcher on a collection of grayscale images, much like the example in Chapter 8 of the CV cookbook (link below). But my question is how can I use this information to calculate a similarity score between the images? I know that just number of keypoints is not enough, but can I use them or the matches in an algorithm to find a score? I've seen so much on the web about descriptor extractors and matchers, but absolutely nothing about what to do with the matches, other than just draw them on the image. Surely there must be a good method for computing a similarity score? Thanks for any guidance you can provide.

http://code.google.com/p/opencv-cookbook/source/browse/trunk/Chapter%2008/tracking.cpp?r=2

Thanks, Nick

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-04-19 08:50:46 -0500

Guanta gravatar image

Hmmm, you could warp your images and compute how much they overlap and build a score out of that.

Alternatively you can use a Bag of Words (BoW) approach (see http://answers.opencv.org/question/8677/image-comparison-with-a-database#8686), where you can group your feature vectors to form one BoW-descriptor. Afaik, there doesn't exist THE similarity score between these descriptors. But you can compare them with your favorite histogram-comparison-method (http://docs.opencv.org/modules/imgproc/doc/histograms.html?highlight=comparehist#comparehist) and derive a similarity score out of it. If you find sth else please report back.

edit flag offensive delete link more

Comments

Thanks for your response, Guanta! I actually tried compareHist already, but it wasn't an option since the images are of different dimensions (mostly varying lengths). I looked at the BoW examples in your link, but they were both in Matlab. Are there any good examples of BoW implemented in OpenCV so that the result is a matching score? I also read something about EMD, which says it can handle images of different dimensions, but I wasn't able to get the code for image signatures working.

NJW gravatar imageNJW ( 2013-04-19 13:39:27 -0500 )edit

EMD can handle Histogram-comparison with histograms of different dimensions, and yes you could also use EMD to compare the BoW-histograms. BoW is not that difficult and OpenCV also has a BoW-wrapper which ease the handling, see http://docs.opencv.org/modules/features2d/doc/object_categorization.html .

Guanta gravatar imageGuanta ( 2013-04-19 14:19:25 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-04-18 17:06:05 -0500

Seen: 2,169 times

Last updated: Apr 19 '13