13,456,887 members
See more:
Dears

I capture a picture with my webcam, and I need to compare it with other picture captured previously.

I tried to compare the two pictures by pixels, but it didn't return me the desired result; sure this occurs because alternating on brightness and alternating on surrounded light waves.

Please advise me which possible way I could go on to resolve this problem.

Note: I don't have an experience with colors or how to deal with it; just knowing RGB and Hex representation :). So try to support me with references as you could.

Thank you
Posted 13-May-11 10:46am

## Solution 1

You can make use of Managed GDI+ Methods to perform this task. Take a loot at the following CP article

Comparing Images using GDI+[^]

Here are a few more reference links:

Comparison Method[^]

Image Processing Technique[^]

Comparison Method 2[^]

Every Image has 2 most important and popular quantity. The Root Mean Square ( RMS ) and Signal to Noice Ratio ( SNR ) these are mere pixel ratio comparisons. Which dont really yield you the actual results.

You can make use of some advanced techniques as mentioned by @orc, or there is one more advanced and an entirely different approach to solve the problem. Which makes use of Frequency domain analysis allowing the measurement of minute distortion regardless of Translation.

You might take a look at those algorithms before you start implementing your solutions :)

BR//
Harsha
v2
orc_orc_orc 13-May-11 17:17pm

wow almost identical :) but you answered earlier haha
ZeeroC00l 13-May-11 17:21pm

:)
orc_orc_orc 13-May-11 18:21pm

you deserve a five.

## Solution 2

Your question can have so many answers since the topic is comparing two images.
There is no correct answer, and there are many unsolved issues in the comparison of images, and there might be no simple solutions which is suitable for you if what you ask for is simple and limited.

Some thecniques for you to look at;

-Scale Invariant Feature Transform[^]
-Template Matching[^]
-Hough Transform[^]

Some basic code examples;

Image Comparison 1[^]
Comparing Images using GDI+[^]
Image Comparison 2[^]
v2
Moustafa Safwat 13-May-11 17:31pm

First of all Thank you for great respond.
Actually I reviewed quickly the articles you supported me with and it has excellent information, but it seems that all compares to fixed images like charts, and the other has an image compare it with itself after modifying something on it.

I'm sorry I'll get short time from you valued time to describe what I need to do; I capture an image every 30 seconds from my room and every time i capture the image I compare it with an image of my room captured previously.
The problem that the two images are same from my point of view because no changes on the room happens but from my comparer method point of view that they are totally deferent because as i said it has changing in motion.

Anther question what is Hash Values

ZeeroC00l 13-May-11 17:48pm

Mere pixel comparison would always act in the way that you mentioned. Since the parameters get changed every other second.

You need look for some algorithm of image comparison that takes into account of Distortion along with translation. If i were you, i would start with Hough Transform..

And Hash value is a unique and compact representation of a piece of data
orc_orc_orc 13-May-11 18:21pm

ZeeroC00l 14-May-11 0:04am

Don't Mention it :) My +5 for those Algorithm links :)

Top Experts
Last 24hrsThis month
 OriginalGriff 290 Maciej Los 230 ppolymorphe 130 CHill60 100 Jochen Arndt 90
 OriginalGriff 5,795 Maciej Los 3,305 CPallini 2,132 Richard Deeming 2,065 Jochen Arndt 1,890