5

I'd like to compare two bitmaps or parts of bitmap and see how alike they are.

I've came across some likeness algorithms for string data, like Levenshtein distance, and Jaro–Winkler distance. these, obviously, do not help when it comes to bitmap data.

Can anyone suggest an algorithm for comparing how alike bitmaps are?


EDIT

Thanks for the ideas,links etc.

While all information is helpful in familiarizing with this topic, I'm wondering how to generate images, something more along the lines of this:

enter image description here

Daniel
  • 34,125
  • 17
  • 102
  • 150
  • You want to generate an image like that given the original Van Gogh as input? Can you clarify? – gordy Jul 11 '11 at 18:25
  • Generating an image with a source, not necessarily like that though. This image was done slicing up stills from a video feed. I'm interested in assessing the likeness more than creating it (though I'd like to know more about that too) – Daniel Jul 11 '11 at 19:26
  • Are you after a likeness routine so that you could randomly evolve an image like that? For that purpose I would say the neural network solution below might work very well. – gordy Jul 11 '11 at 20:00

4 Answers4

3

You could use Hausdorff image comparison, but be aware that this expects binary images.

Of note, visually similar images may have vastly different underlying pixel representations. Human perception makes computing visual similarity quite difficult. Hausdorff deals well with this by allowing two different images to score highly when the general similarity is the same.

If you want to compute data distances, you can use any distance metric you like and do so directly on the pixels. I'm particularly fond of Mahalanobis distance for these kind of comparisons.

Mark Elliot
  • 75,278
  • 22
  • 140
  • 160
1

Here's an interesting link from a similar question. Using a self training neural net to recognize similar images.

Community
  • 1
  • 1
gordy
  • 9,360
  • 1
  • 31
  • 43
1

You want to use a Hilbert Curve to subdivide the image and read the rgb values. Then you can use a Fast Fourier Transformation to record the image into a discrete analog signal. Then you can store this into a database and compare it with other results. The results should be very good. In fact this is like the Quantiziser step in the JPEG compression (hilbert curve) except that the JPEG compression uses a Morton Curve.

Micromega
  • 12,486
  • 7
  • 35
  • 72
1

Neural networks also bring solution. You can use Kohonen network (it will group your images into classes and give topological map of them) or use Hopfield network (provide some representative images and after learning procedure images will be classified by network to images provided in learning mode).

Kohonen networks: http://en.wikipedia.org/wiki/Self-organizing_map

Hopfield network http://en.wikipedia.org/wiki/Hopfield_network

dfens
  • 5,413
  • 4
  • 35
  • 50