Comparing two images/pictures

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 comentarios

Anon
Anon el 22 de Mzo. de 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
d-va el 22 de Mzo. de 2011
The reason im asking here is because the system source code is to be designed using Matlab.

Iniciar sesión para comentar.

Respuestas (2)

Matt Fig
Matt Fig el 22 de Mzo. de 2011

1 voto

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 comentarios

d-va
d-va el 22 de Mzo. de 2011
If the images match(with a certain threshold for error due to lighting or so), i would use the it to trigger the release of a locking mechanism.
Matt Fig
Matt Fig el 22 de Mzo. de 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
d-va el 23 de Mzo. de 2011
what i meant with to match with a certain threshold :-
let say i have image1,image2 and image3 in my database. A new input image4 is given, the new image will be compared to image1,image2 and image3. If there is a match with the images in the database, image4 is accepted. If not, it is rejected.
Sean de Wolski
Sean de Wolski el 23 de Mzo. de 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
Matt Fig el 23 de Mzo. de 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
Sean de Wolski el 23 de Mzo. de 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
Matt Fig el 23 de Mzo. de 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!

Iniciar sesión para comentar.

VINAY DEVANIDI REDDY
VINAY DEVANIDI REDDY el 28 de Mzo. de 2017

0 votos

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 "..

Categorías

Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 22 de Mzo. de 2011

Comentada:

el 22 de Ag. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by