I have calculated SIFT descriptors for Image A and B with python 2.7 using openCV python. Image A has 16X128 (=2048) descriptors and Image B has 10X128 (=1280). now I got stuck because I don't know how to generate a similarity score. I would appreciate you if you can help me.
score or similarity term is the measurement between a pair of matched descriptors (e.g. Euclidean distance) But comparing the SIFT descriptors themselves in an image to those of another is not feasible because you will end up with multiple SIFT descriptors in an image, and their number varies depending on how you extract them as I mentioned before image A has 16X128 (=2048) descriptors and the other has 1028.
In matlab VL-feat, SCORE has been implemented as follow:
[fa, da] = vl_sift(Image_a) ;
[fb, db] = vl_sift(Image_b) ;
[matches, scores] = vl_ubcmatch(da, db) ;
Finally, I want to calculate imposter and genuine scores and then I want to calculate EER.
I would like to draw your attention that I don't want to use any of following approaches:
- VLfeat in Matlab
- BoW (Bag of word) algorithm ( Euclidean distance in sift )
- Answer in Interpreting score in SIFT
Thank you.
this is how I extracted SIFT keypoint and descriptors:
import cv2
def extractFeatures_SIFT(Imagelist):
l = len(Imagelist)
featurlist = []
for img_path in Imagelist:
img = img_path
img = cv2.imread(img)
sift = cv2.xfeatures2d.SIFT_create()
(kps, descriptor) = sift.detectAndCompute(img, None)
featurlist += [kps, descriptor]
return featurlist