MATLAB Answers

0

What is the procedure of finding out the accuracy of the images in matlab?

Asked by diva dave anthony on 12 Apr 2013

Actually i have find out eucledian distance of the query image and the images in the databases..Now my question is that how to find out the accuracy in the images using matlab..please help me.Thank you..

  3 Comments

Actually i have find out eucledian distance of the query image and the images in the databases..Now my question is that how to find out the accuracy in the images using matlab..Please help me.Thank you.

i have done the program given below..please help me to find the accuracy in all the images..thank you.

clc;
G=imread('lion1.jpg');
G1=rgb2gray(G);
H = adapthisteq(G1);
[rows cols]=size(G1); 
[c1,s1]=wavedec2(H,1,'db1');
%disp(c1);
X=c1;
figure,imshow(G);
%figure,imshow(H);
fileFolder=fullfile(matlabroot,'toolbox','images','imda');
dirOutput=dir(fullfile(fileFolder,'*.jpg'));
fileNames={dirOutput.name}
n=numel(fileNames)
g=zeros(1,n);
for k = 1 : n
  fileNames1=strcat('fullfile(fileFolder)',fileNames(k))   
  I = imread(fileNames{k});
  I1=rgb2gray(I);
  J = adapthisteq(I1);
  J = imresize(J, [rows cols]);
  [c2,s2]=wavedec2(J,1,'db1');
  %disp(c2);
  Y=c2;
  %[rows1 cols1]=size(J);
  E_distance = sqrt(sum((X-Y).^2));
  g(1,k)=E_distance;
  if g(1,k)==0
      w=k;
  end
  %figure,imshow(I);
  %figure,imshow(J);
end
disp(g);
%II=imread(fileNames{w});
%figure, imshow(II);
[sorted,IX] = sort(g);
bestFiveImages = IX(1:5);
for I = 1:length(bestFiveImages)
   figure;imshow(imread(fileNames{bestFiveImages(I)}));
end

Editing away your question is very very much despised and will lead to people not answering your questions in the future.

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.

1 Answer

Answer by Image Analyst
on 12 Apr 2013
 Accepted answer

Assuming you found the best five images correctly, change the last few lines to this (untested):

figure;
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
for k = 1:length(bestFiveImages)
   subplot(2, 3, k);
   fullFileName = fullfile(pwd, fileNames{bestFiveImages(k)});
   if exist(fullFileName , 'file')
      imshow(imread(fullFileName));
      title(fullFileName, 'FontSize', 20);
   else
      warningMessage = sprintf('Warning: file not found:\n%s', fullFileName);
      uiwait(warndlg(warningMessage));
   end
end

  11 Comments


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!