i have calculated the distance of one image with 30 images,now i want to find the nearer distance with the smallest diatance and wnat to diaplay the images having small distance with the input image i.e the similar images.
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
b=dlmread('features38.mat')
%b1=dlmread(fr)
b1=dlmread('frs.mat')
sum=0;
for i=1:8
g = (b(i) - b1(j,i))^2
sum=sum+g
end
dist = sqrt(sum);
E_dist(j)=dist
disp(E_dist);
if(E_dist(j) <.0022)
subplot(3,3,m)
imshow(I);
m=m+1;
end
end
sd=sort(E_dist)
0 件のコメント
回答 (1 件)
Image Analyst
2014 年 6 月 21 日
First of all DO NOT USE SUM AS THE NAME OF A VARIABLE BECAUSE IT DESTROYS THE BUILT IN SUM() FUNCTION!
I'm not sure what that for loop does anyway. But if E_dist is a list of your distances, to find the index with the smallest distance, use min()
[minDistance, indexOfMin] = min(E_dist);
Then display the pair of images with imshow().
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!