Skip to main content
GameDev.net gamedev.net
🔒 Locked

What is the best image matching/comparison algorithm?

Started by Rasterman Jun 28, 2006 at 9:53 PM 5 replies 25.2k views
Original Post
Rasterman
Rasterman
I am trying to find which 2 images out of a set of images look the most alike. Currently I am using the sum each color component after XOR ing the pixels of the 2 images, and doing this with every image combination. for all pixels diffpixel = pixel1 XOR pixel2 sum += RED(diffpixel) + GREEN(diffpixel) + BLUE(diffpixel) I was wondering if anyone had any suggestions for a better image matching algorithm, would converting to HSV be better, and why?
smr
smr
Hoiw accurate do you need to be?
Rasterman
Rasterman
Accurracy is not too important, the processing is not real time. I am trying to calculate which 2 images from a set are closest looking, I have been researching using the YUV colorspace, and tweak my algorithm to use 100% Y and maybe 50% B and R and 100% G, since the human eye is much more sensitive to brightness than color, and more sensitive to G than R and B as most ppl know.
python_regious
python_regious
This paper deals with the classification of colour images. It uses colour and texture distances to match an input image with that of one in a database. The method it uses to calculate the colour size distribution is a bit shit, but otherwise it could be a good starting place for you.
If at first you don't succeed, redefine success.
python_regious
python_regious
Although, in all fairness if you just wanted a gauge as to how different the images are you could just use the NMSE.
If at first you don't succeed, redefine success.
pgregory
pgregory
If you're looking for something that can compare images using a model of the human perception system, we on the Aqsis project use this...

http://pdiff.sourceforge.net

...for our regression testing suite. It identifies differences between images that would be noticed by our own perception system, thus eliminating false negatives introduced by simple differences between floating point implementations etc.

Cheers


PaulG
Tachikoma
Tachikoma
You might also want to look into normalized cross correlation filters, although they tend to be more useful for matching sub-regions of an image (such as recognising objects, etc).

Image matching is a very broad subject. It really depends on what application you want this for. Are there any particular features in the image that you're concentrating on? For example, are you more interested in matching images that contain similar shapes, objects, edges (like a portrait vs. a photo of a car), or do you have a set of very similar images and only want to discriminate subtle changes?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.