views:

83

answers:

1

I'm trying to do some simple and fast image comparison of similarity.

All of the images are of the same size. The color differences are quite delicate.

Currently, I calculate a difference measure by calculating the sum of difference in the R,G and B values between the images, sort of a Hamming distance.

That is,

Abs(P1.R - P2.R) + Abs(P1.G - P2.G) + Abs(P1.B - P2.B)

for every (x,y).

I was imagining a simple binary image (black and white) with black background and a white pixel on it. I realized that it doesn't matter where I would put the white pixel in another position in a second image, it would always produce the same difference (compared to first image) with the procedure above.

Imagine two 10x10 black images with white pixels in the opposite corners. Now a third black image with a white pixel at very near a corner. The one in the opposite corner and the third one, which has the white pixel very near to the first image, produce the same similarity while clearly the third one is much more similar to the first one.

I need to somehow add positional information as to where the difference occurs (not sure if this is well put). What am I missing?

This is for anti-aliased font-recognition. I have a few source images for every character, but the input image can have the character slightly (few pixels) to the left or the right compared to the source image and small differences in the anti-aliased pixels around it, depending on which characters is on the left and right of it.

A: 

Hm that is pretty much the problem of digital image processing. What you do in your case is:

Find some attributes that apply to what you want to do e.g.

  • color distribution
  • histogramm similarity
  • center of mass of your binary image
  • perimeter and area (in %)
  • etc.

Create a characteristics vector from your image and compare it to your sample data vectors. Find the smallest euclidian distance between your sample data vector and your processed image characteristic vector and that is your guess to what you processed image might apply to.

Daff