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)
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)

Answers (1)

Image Analyst
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..

Categories

Find more on Display Image 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!