Check if two images are similarity or not.

asked 2015-07-20 02:33:29 -0500

ndk076 gravatar image

updated 2015-07-20 02:45:49 -0500

I'm doing a demo to find all similar images of user's input image in collections of images.

It is similar to this example http://ramsrigoutham.com/2012/11/22/p... but what I want is return list of images that similar to the user's input image (All images are similar that taken in different angle have to be showed in result lists).

So I'm using OpenCV Java to it as following:

  • detectKeypoints using FeatureDetector.FAST;
  • computeDescriptors using DescriptorExtractor.SURF;
  • fetureMatching using DescriptorMatcher.FLANNBASED;
  • Then call Calib3d.findHomography(obj, scene, Calib3d.RANSAC, 3) to find Mat object of inline points.

My question here is how can I check if two input images are similar or not because the return result from findHomography(...) is still a Mat object (not something like boolean value TRUE Or FALSE) And my demo require to run in real-time environment. So algorithms I used (FAST, SUFT, FLANNBASED) is correctly to adapt in real-time environment or not ?.

Thanks!

edit retag flag offensive close merge delete

Comments

Guess you need another type of algorithm: have a look at "bag of words" (you'll find also some answers here in the forum regarding this).

Guanta gravatar imageGuanta ( 2015-07-20 07:27:27 -0500 )edit

Thanks for your suggestion Guanta.
Do you have good example links to solve my current issues if use "bag of words" ?

ndk076 gravatar imagendk076 ( 2015-07-20 09:19:29 -0500 )edit

hmm, bow is a good idea, but it's unfortunately not available from java, atm.

berak gravatar imageberak ( 2015-07-21 01:40:28 -0500 )edit

here's one answer I gave a while ago about bow: http://answers.opencv.org/question/86... . As berak said, there doesn't exist a wrapper for bowExtractor etc. in java, however all this is not complicated, just have a look at the cpp implementation. Good luck!

Guanta gravatar imageGuanta ( 2015-07-21 09:56:24 -0500 )edit

Thanks for your suggestion. I just have found it http://answers.opencv.org/question/25... , is it good to use to determine good homography when we use a way as I describe in my question, and if so, how can we convert to Java because I don't clearly understand some numbers he use in If condition.

ndk076 gravatar imagendk076 ( 2015-07-21 23:55:02 -0500 )edit