I have calculate the euclidean distance between two mat files,one file store the color values of one image and other for 30 image.and I get the smallest distance. Now How i display the image having the smallest distance with the first image.
1 次查看(过去 30 天)
显示 更早的评论
a = imread('11.jpg'); %a = rgb2gray(a); b=dlmread('features11.mat') b1=dlmread('frs.mat') for i=1:30 sum=0; for j=1:8 g = (b(j) - b1(i,j))^2 sum=sum+g end
E_distance = sqrt(sum)
%x(i)=sum;
distance(i)= E_distance
disp('E_distance=')
disp(E_distance);
end
smallest=min(distance)
disp('smallest=')
[smallest,I] = min(distance)
0 个评论
回答(1 个)
Image Analyst
2014-6-20
You can use imshow() twice to two separate axes, or you can use imshowpair() to display side-by-side, or imfuse() to display on top of each other in different colors..
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!