to show 5 images having smallest eucledian distance with respect to query image.
Show older comments
Suppose i have one query image and a database in matlab having 10 images..i have read out and showed one image which has smallest eucledian distance with respect to query image.but now i want to read and to show atleast 5 images from that database which has nearest eucledian distance with respect to query image,that means i want to read and show 5 images in 5 different windows all together.
my program for reading and showing one image with respect to query image which has smallest eucledian 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);
How will i read and show atleast 5 images from that database which has nearest eucledian distance with respect to query image,that means i want to read and show 5 images in 5 different windows all together.
3 Comments
diva dave anthony
on 28 Mar 2013
Image Analyst
on 13 Apr 2013
Editing away your question is very very much despised and will lead to people not answering your questions in the future.
Randy Souza
on 26 Apr 2013
I have restored the original text of this question.
diva dave anthony: this question has a clear subject and an accepted answer, so it may be valuable to someone else in the future. If you have a good reason why it should be removed from MATLAB Answers, please flag the question, explain why it should be deleted, and an administrator or high-reputation contributor will consider deleting the question. Please do not simply edit your question away.
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing 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!