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 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Image Analyst
on 20 Jun 2014
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 Comments
See Also
Categories
Find more on Display Image in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!