## Compare two images

### Compare two images

I know that Algorithm for comparing two images is really hard to do and
still in research.

My question is :

1. How to find similarity of two images? (It doesn't have to be exact
comparasion but at least the algorithm could find a percentage of the
similarity.)

2. How to build a histogram of an image? (URL to Algorithm / Source Code)

3. How to compare two histograms ?

cheers

### Compare two images

This is an image processing question; I'm sure you'll get better answers
if you ask in sci.image.processing (or something like that)

// michael

> I know that Algorithm for comparing two images is really hard to do and
> still in research.

> My question is :

> 1. How to find similarity of two images? (It doesn't have to be exact
> comparasion but at least the algorithm could find a percentage of the
> similarity.)

> 2. How to build a histogram of an image? (URL to Algorithm / Source Code)

> 3. How to compare two histograms ?

> cheers

### Compare two images

> 1. How to find similarity of two images? (It doesn't have to be exact
> comparasion but at least the algorithm could find a percentage of the
> similarity.)

1. Tell me how do you *define* your similarity, I will tell you how to
find it.
The texture resynthesizers (a la Heeger) and MPEG compressors define
the similarity *VERY* differently.

Quote:> 2. How to build a histogram of an image? (URL to Algorithm / Source Code)

2. Split your colour space in bins.
Allocate and zero an array H, one element per bin.
foreach pixel in the image
if its colour belongs to the bin k,  H(k)++.

If your image is trueColour, probably you should build one histogram
per colour component (On RGB, or YCrCb or any other space provided you
know what do you really want...)
If it is indexed, half of the work is done, but you should retrieve the
attached palette in order to see some sense in the histogram built.

Are you sure you ever tried to think about it yourself?

Quote:> 3. How to compare two histograms ?

3. What do you mean by "compare"? define it, I will tell you "how".

===

4. I detest unsigned, anonymous letters.

Jerzy Karczmarczuk

### Compare two images

> I know that Algorithm for comparing two images is really hard to do and
> still in research.

Nope.
The problem pertains to Artificial Intelligence and is 20 years old.

Quote:

> My question is :

> 1. How to find similarity of two images? (It doesn't have to be exact
> comparasion but at least the algorithm could find a percentage of the
> similarity.)

Could you let me know, your definition of similarity first ?
Image recognition is well done nowadays.

All i need is more details refering to your problem.

Jacek
--
Projektowanie optymalnych rozkrojow blachy, skory, szkla, tkanin,
drewna.    True Shape Self(EGO) Nesting Technology world-wide.

Hello!

I need to compare two files  in, say, TIFF format. One of them
is saved by  a fax-receiving software after the  other one was
sent by  fax-sending software. You  get the idea --  the files
will not  look _very_ different  to a human, may  obviously be
quite different inside.

I was wondering, if there  are any algorithms, preferably with
an open source implementation, of  course :-), to estimate the
quantifiable  differences, so  that a  human tester  will only
have to examine SOME of the received copies.

Thanks in advance for any hints.

-mi