Comparing two images/pictures
Ältere Kommentare anzeigen
I am trying to write a code to compare 2 images/pictures to ensure they match. This is to be used as part as a face recognition system. So i would have to compare the new image that will be taken against a set of images that i have already saved.
Would appreciate some help as im very new to using this system.
2 Kommentare
Anon
am 22 Mär. 2011
What does this question have to do with Matlab? What about searching the literature for suitable measures for comparing images? If you find a measure that fits your needs, come back to this forum and ask for advice on its implementation in Matlab.
Anon
d-va
am 22 Mär. 2011
Antworten (2)
Matt Fig
am 22 Mär. 2011
1 Stimme
You will have to quantify what you mean when you want to know if images match. Do you mean that they should be identical? Or that each pixel should differ by only a small amount?
7 Kommentare
d-va
am 22 Mär. 2011
Matt Fig
am 22 Mär. 2011
Again, what does it mean to "match with a certain threshold?" Does it mean, for example given two images I1 and I2 and threshold thresh:
max(abs(I1(:)-I2(:)))<thresh
This will return true if every value in I1 is within thresh of the same value in I2.
d-va
am 23 Mär. 2011
Sean de Wolski
am 23 Mär. 2011
Yes. But what do you mean by match?!?!?!
Exact copy?
isequal(I1,I2);
close: as Matt suggested or a normalized x-correlation.
Matt Fig
am 23 Mär. 2011
I don't know how to get through to you, d-va. I asked you what you meant by the images matching within a certain threshold. You told me what you would do if the images match. That does not answer the question. You see, MATLAB is a programming language and, as such, its use in solving a problem for you will depend entirely on your ability to specify the problem. Computers are strictly obedient - that is, they do only what you tell them to do, and nothing more. So to get MATLAB to tell you if two images match, you MUST define _exactly_ what you mean by "match within a certain threshold."
You can try if you want to write a program in MATLAB with the line, "If the images match, accept it," but I don't think you will get anywhere.
Sean de Wolski
am 23 Mär. 2011
Matt, that won't work:
%%
if the images match,
accept it
end
??? Undefined function or variable 'the'.
>> the = 2; images = 3; match = 4; accept = 5;it=6;
>> if the images match,
accept it
end
??? Error: "images" was previously used as a variable,
conflicting with its use here as the name of a function or command.
See MATLAB Programming, "How MATLAB Recognizes Function Calls That Use Command Syntax" for
details.
>> :)
Matt Fig
am 23 Mär. 2011
I thought that would be the case! Thanks for taking the time to investigate this, Sean de. It was worth a try anyway, you never know just how clever these MathWorkers are getting.
I guess MATLAB does have room for improvement indeed!
VINAY DEVANIDI REDDY
am 28 Mär. 2017
0 Stimmen
hi, this is vinay.
I am doing a project regarding eye detection system . The concept is that eye tracking will be done on a subject1 and the images are compared with one general image of an eye of another subject2 . subject 2 image is constant . When the image matches then it means that the subject is looking at me . When the new image sometime later doesnt match which means that the subject 1 is not looking at me , then the image wont be similar to the subject 2 image . This should trigger a signal to an audio device on subject 1 telling it to " look at me "..
1 Kommentar
Rajat Mehta
am 22 Aug. 2020
did you figure it out?
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!