HenryLadung
HenryLadung

Reputation: 41

OpenCV: Compute confidence in image matching

i write an app where the user takes the picture of a logo and the app tries to find the right logo in its database. Therefore i use the cv2.SIFT() algorithm and basically a modified version of the find_obj.py example (https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/python2/find_obj.py?rev=6080).

The script now gives me values for "matches" and "inliers" and I have trouble finding out how to compute the logo that fits best. First i just took the image with most matches or inliners but it was often the wrong choice. Then I used inliers/matches as a confidence value but it could well be that one logo has a value of 4/5 (0.8) and the right one has 16/24 (0.66). So I tried to weight the number of matches like this inliers/matches*matches*0.3 but of course i have no clue how to really weight it.

Any advice what to do?!

Upvotes: 2

Views: 1339

Answers (1)

Aaron
Aaron

Reputation: 2364

You could try taking each match and computing the alignment between your image and the reference image. Then warp your image to align with the reference image and compute the error in that space.

Upvotes: 2

Related Questions