Opencv Repeatability Result not make sense?
Asked Answered
E

2

6

i'm trying to evaluate SIFT and SURF Detectors by Repeatability criteria.

i find out that below method can find Repeatability ,Correspondence of SIFT and SURF

 cv::evaluateFeatureDetector(img_1c, img_2c, h12, &key_points_1, &key_points_2, repeatability, corrCounter);

some of the result are listed below:

Number  Repeatibility   Correspond  Keypoint 1st    Keypoint 2th    
1to2    0.7777778            140        224              180    
1to3    0.7125               114        224              161    
1to4    0.704918              86        224              123    
1to5    0.6853933             61        224               89    
1to6    0.6521739             45        224               69

for first row repeatibility can compute as --> (correnspond)/min(keypoint1st,keypoint2th) = (140/180) = 0.7777778 but for other rows it's value is different from what i compute with above formula.

can somebody tell why is that happening?

Regards.

Erhart answered 23/9, 2014 at 10:21 Comment(1)
which openCV version do you use?Trocar
M
5

I think I may have found the problem here.

The repeatability rate is the number of repeated points between two images considering the total number of keypoints extracted. For measuring the number of repeated points it has to be taken into account that the observed scenes differ from each other due to their changed imaging condition (viewpoint, rotation + scale, blur, etc in the case of Mikolajczyk dataset).

Keypoints which are not detected in both images can corrupt the repeatability measure so, only points which lie in the common scene parts affect the repeatability.

What is happening is that you're considering all the keypoints detected in the second image for the calculation of repeatability and actually only the keypoints within the homography should be used.

Hope this helps.

Mcgregor answered 25/9, 2014 at 16:30 Comment(3)
I was thinking the same thing but i wasn't sure about it, i still don't know if its the case . but thanks for reply. i will wait for better answer . if no one got better answer i will accept yours.Erhart
You can confirm it if you draw the homography and keypoints in the second image. If you detect keypoints in the image2 only inside of the homography and in the other images you don't, the problem is exactly what I said above. Please let me know if I'm not explaining well somewhere.Mcgregor
How can I retrieve "only the keypoints within the homography should be used"?Gorham
T
1

In fact, OpenCV 2.49 uses this line of code in evaluation.cpp:

repeatability = minCount ? (float)correspondencesCount / minCount : -1;

which is the number of correspondences divided by the smaller number of Keypoint 1st or Keypoint 2th so I guess your error might be somewhere else. Can you post your complete code where you set img_1c, etc and call the function and display the results?

Trocar answered 23/9, 2014 at 13:27 Comment(2)
I use OpenCV 2.46 . i findout that if i make changes to image by opencv function repeatability match the formula . but somehow on Mikolajczyk Dataset this issue occures.Erhart
For example if i use GaussianBlur filter , rotation, adding noise or ... by opencv methods i get expected repeatability result. i use same code for evaluating and finding images keypoints in both dataset(synthesis dataset and Mikolajczyk dataset)Erhart

© 2022 - 2024 — McMap. All rights reserved.