comparing single image with many images
Ältere Kommentare anzeigen
I have written a matlab function that enables me to get the name of image from user and compare it with the existing images and display if it matches or not..
function matchin
handles = guidata(gcbo);
set(handles.h_text,'String','performing matching...');
[image1, pathname]= uigetfile('*.bmp','Open An Fingerprint image');
Directory = fullfile ('F:','matlab','bin');
D = dir(fullfile(Directory,'*.bmp'));
set(handles.h_text,'String','matching complete....');
for i = 1:numel(D)
if strcmp(image1,D(i).name)
disp('matched');
else
disp('not matched');
end
end
the above code checks if the file name exists but i now want to compare the images itself instead of the file name. How can I do that?Please help..
Regards
Priya
9 Kommentare
Walter Roberson
am 30 Mär. 2013
What does "compare the images" mean to you in this context?
Anand
am 30 Mär. 2013
If you're looking for complete equality (of all pixels with no tolerance), use isequal(im1,im2)
Note that such comparisons are usually not useful in any meaningful image comparison.
Padmapriya
am 30 Mär. 2013
Padmapriya
am 30 Mär. 2013
Padmapriya
am 30 Mär. 2013
Padmapriya
am 30 Mär. 2013
Walter Roberson
am 30 Mär. 2013
You can use http://www.mathworks.com/help/matlab/ref/imfinfo.html to test to see if the file contains an image, and check its sizes and some other information. For example if the contained image is a different size than your original then you can say that it is not the same image.
sirisha boddapati
am 15 Jul. 2018
The prgrm shows error in line 4 ...what should we do??? Plz ans this...
Image Analyst
am 15 Jul. 2018
You should start a new question of your own with all the source code, data, and error messages needed for us to help you.
Akzeptierte Antwort
Weitere Antworten (2)
gagan deep
am 15 Jun. 2014
0 Stimmen
Umara Zafar
am 9 Jun. 2017
Bearbeitet: Image Analyst
am 9 Jun. 2017
I used the same code for my project
function matchin
handles = guidata(gcbo);
set(handles.h_text,'String','performing matching...');
[image1, pathname]= uigetfile('*.bmp','Open An Fingerprint image');
Directory = fullfile ('F:','matlab','bin');
D = dir(fullfile(Directory,'*.bmp'));
set(handles.h_text,'String','matching complete....');
for i = 1:numel(D)
if strcmp(image1,D(i).name)
disp('matched');
else
disp('not matched');
end
end
But i'm getting this error "H must be the handle to a figure or figure descendent." Anyone can help ? Thanks
1 Kommentar
Image Analyst
am 9 Jun. 2017
There is no capital H in your code. Post a new, separate question and post all the red text so we can see the actual line of code that is throwing the error.
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!