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 Ansicht (letzte 30 Tage)
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)

Antworten (1)

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

Kategorien

Mehr zu Display Image finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by