0

I am a new in OpenCV. Currently, I want to write the demo using OpenCV feature matching to find all the similar images from the set of images. Firstly, I want to try to compare two images first. And I use this code to do: openCV: creating a match of features, meaning of output array, java So I tested this code by input two similar images but has one is the rotation. And then I try to input two totally different images such as lena.jpeg vs car.png (any car).

I see that the algorithm still return matches matrix between two those different images.

My question here is how can I point that one case is similar image and one case is not after I got this matrix: flannDescriptorMatcher.match(descriptor1, descriptor2, matches.get(0)); because I don't want to draw matching point between two images, I want factor to distinguish those case.

Thank!

Kallz
  • 3,244
  • 1
  • 20
  • 38
ndk076
  • 165
  • 12
  • The closest thing you need to study is how to cluster similar images. How to categorize images (object categorization). But if you want something very simple, histograms will do. That's how you decide if two images look alike or not. Feature matching is when you know that a "small" image is inside a "bigger" image. – LovaBill May 21 '15 at 13:37
  • Also read this http://stackoverflow.com/questions/4196453/simple-and-fast-method-to-compare-images-for-similarity – LovaBill May 21 '15 at 13:39
  • Thanks for your comments William. The reason why I choose feature matching because it's base on my requirement (I'm sorry when I forgot it in my question). I have to detect images that captured in different angle, not only exactly similar in object or just different in background color. And I know histograms can not do it, right? Do you have any idea about it? Or do you know in OpenCV has any different ways to solve this kind of thing or not. I'll very appreciate it! – ndk076 May 22 '15 at 11:17
  • Your problem sounds similar to [image stitching](http://ramsrigoutham.com/2012/11/22/panorama-image-stitching-in-opencv/), where a part of one image is a part on another under a small affine transformation. Study how the features are matched and you'll have your answer. Opencv provides a [class](http://docs.opencv.org/modules/stitching/doc/stitching.html) for this. – LovaBill May 22 '15 at 13:45
  • Thanks you a lot! This is really what I need. I also look at the example image stitching you provide in above comment. After this step: // Find the Homography Matrix Mat H = findHomography( obj, scene, CV_RANSAC ); I get the matrix H. And base on this example : http://answers.opencv.org/question/2588/check-if-homography-is-good/ I can check determinant Homography to decide whether two images similar or not, But I dont know how to do it in Java with corresponding function . Can you help me about this? Many thanks. – ndk076 May 24 '15 at 03:51
  • I mean in step check if hornography is good or not, i can find relevant cvmGet in the OpenCV Java to calculate determinant hornography. Could you hep me? – ndk076 May 24 '15 at 04:05
  • 1
    Anw, Thanks you you alot Wiiliam. I found the function Core.determinant(Mat) can do it. – ndk076 May 24 '15 at 05:04

0 Answers0