Why am I getting same Euclidean Distance for different images ?
Show older comments
I am trying to write a code that will indicate which two images are similar out of three.
% OBJECT: Comparing sift features by euclidean distance
%%Reading Images
img1=imread('106aa.jpg');
img2=imread('107aa.jpg');
img3=imread('107bb.jpg');
%%Resizing Images
resize1=imresize(img1, 0.25) ;
resize2=imresize(img2, 0.25) ;
resize3=imresize(img3, 0.25);
%%Converting rgb images to gray scale images
gray1=rgb2gray(resize1);
gray2=rgb2gray(resize2);
gray3=rgb2gray(resize3);
%%Converting to single precision
% because sift only work on single precision
Ia=single(gray1);
Ib=single(gray2);
Ic=single(gray3);
%%Extracting sift features
[fa, da] = vl_sift(Ia) ;
[fb, db] = vl_sift(Ib) ;
[fc, dc] = vl_sift(Ic) ;
[matches1, scores1] = vl_ubcmatch(da, db) ;
[matches2, scores2] = vl_ubcmatch(db, dc) ;
%%Comparing features vectors by Euclidean distance
fv1= [ 'fa' 'da' ] ;
fv2= [ 'fb' 'db' ] ;
fv3= [ 'fc' 'dc' ] ;
diff1 = fv1 - fv2;
distance1 = sqrt(diff1 * diff1')
diff2= fv2 - fv3 ;
distance2 = sqrt(diff2 * diff2')
Accepted Answer
More Answers (1)
Image Analyst
on 6 Jan 2014
See section 21.4.2.7 here: http://iris.usc.edu/Vision-Notes/bibliography/contentspeople.html#Face%20Recognition,%20Detection,%20Tracking,%20Gesture%20Recognition,%20Fingerprints,%20Biometrics
21.4.2.7 American Sign Language, ASL Recognition
21.4.2.7.1 Sign Language, Other Languages, Chinese, Arabic
21.4.2.7.2 Sign Language, Fingerspelling
Categories
Find more on Feature Detection and Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!