How to recognize detection fact
Hello everyone. I'm new with opencv. I read tutorials and forums, related to opencv, but still have some problem...
My task is to find object on the photo using Keypoint descriptors scheme (Feature Detection/ Descriptor Extraction / Matcher). How can I determine that object is found on the image?
For now, I found method of calculating SVD ratio of singular values of homography. But when the image is rotated close to 180 degrees clockwise it's singular ratio becomes very large. Is there any way to fix this?
Maybe this task has other standard solution?
Thanks in advance!
Hi, can you point the source for that "method of calculating SVD ratio" that you mentioned?
SVD::compute(homogramma, w, u, vt);
expr = w.at<double>(0,0) / w.at<double>(0,2);
dt = determinant(homogramma);
homogramma_is_good = abs(dt)<2 && expr<600000;
Sorry, when I said the source I meant, where did you read about it? :)
http://answers.opencv.org/question/1090/good-result-or-bad-result-for-findhomography/
http://stackoverflow.com/questions/10972438/detecting-garbage-homographies-from-findhomography-in-opencv
Hi, your question is a little bit confusing to me.
One way to test if you found the object in a given image is indeed try to extract the homography (using findHomography) and then test its singular values, just like you are doing. Another way is to see if at least you have a minimum number of matches.
If your question is about why the homography is not good after a rotation, please tell us what kind of points are your using (SIFT, SURF, ORB, etc.) and what are the descriptors. Some descriptor are not rotation invariant, so...
I think i can`t definitely determine if we found image by counting matches. That's why I didn't test it. If you can link me to the good method how it must be done - it would be great. Or maybe you know some other good methods without using homography?
For testing I use two methods: 1) visual: I draw rectangle around matched object and if it's proportions are the same as of source image rectangle - object is found. For drawing I use homography. 2) programmatically: as I described above by checking SVD and determinant.
But when I tested this on rotated image - visual rectangle is good, but program checking fails: determinant is good, but SVD is bad.
For testing I used different descriptors and detectors. For example, ORB + ORB and ORB + FREAK. Problem is found in both variants.
Another problem is to find the limits for SVD and determinant to check the matching. For now I use values, which founded from the set of experiments. Maybe there is some way to get them from object image size/quality or something else?