Suppose I have one query image, and a database in matlab that has 10 images. I can read out and show one image which has smallest Euclidean distance with respect to query image. But now, I want to read and show at least 5 images from that database, which means I want to read and show five images in five different windows.
My program for reading and showing a single image with the has smallest Euclidean distance is as follows:
G=imread('spine.tif');
H = adapthisteq(G,'clipLimit',0.01,'Distribution','rayleigh');
[rows cols]=size(H);
[c1,s1]=wavedec2(H,1,'db1');
X=c1;
figure,imshow(G);
figure,imshow(H);
fileFolder=fullfile(matlabroot,'toolbox','images','imdata');
dirOutput=dir(fullfile(fileFolder,'*.tif'));
fileNames={dirOutput.name}
n=numel(fileNames)
g=zeros(1,n)
for k = 1 : n
fileNames1=strcat('fullfile(fileFolder)',fileNames(k))
I = imread(fileNames{k});
J = adapthisteq(I,'clipLimit',0.01,'Distribution','rayleigh');
J = imresize(J, [rows cols]);
[c2,s2]=wavedec2(J,1,'db1');
Y=c2;
E_distance = sqrt(sum((X-Y).^2));
g(1,k)=E_distance;
if g(1,k)==0
w=k;
end
end
disp(g);
II=imread(fileNames{w});
figure, imshow(II);
My question is, how can I read and show at least five images from that database, in five different windows.