views:

38

answers:

1

I want to compare two images. On both images you can see a digit. For example: (img1: "5" img2: "5") img1 is a pure black digit. But img2 could be in various colors. The background is white. It doesn't matter what color is on img2, if there is a "5", it has to be matched.

How do I compare these images? It has to be a fast method.

Any clues?

+1  A: 

If you know the background is always white, you could process the two images and whenever a pixel is not white, set it's color to black - essentially converting both images into black & white bitmaps.

Then you could compare the bitmaps. I'm assuming you have that part already covered. Otherwise, if the two images are supposed to be exact matches then you would go and compare each pixel to the other image for an exact match. If a pixel doesn't match.. they are not the same. But this is very naive.. much better image recognition methods exist.

Miky Dinescu