I need an algorithm that can determine whether two images are 'similar' and recognizes similar patterns of color, brightness, shape etc.. I might need some pointers as to what parameters the human brain uses to 'categorize' images. ..
I have looked at hausdorff based matching but that seems mainly for matching transformed objects and patterns of shape.
My lab needed to solve this problem as well, and we used Tensorflow. Here's a full app implementation for visualizing image similarity.
For a tutorial on vectorizing images for similarity computation, check out this page. Here's the Python (again, see the post for full workflow):
You could use Perceptual Image Diff
It's a command line utility that compares two images using a perceptual metric. That is, it uses a computational model of the human visual system to determine if two images are visually different, so minor changes in pixels are ignored. Plus, it drastically reduces the number of false positives caused by differences in random number generation, OS or machine architecture differences.
You could perform some sort of block-matching motion estimation between the two images and measure the overall sum of residuals and motion vector costs (much like one would do in a video encoder). This would compensate for motion; for bonus points, do affine-transformation motion estimation (compensates for zooms and stretching and similar). You could also do overlapped blocks or optical flow.
I have done something similar, by decomposing images into signatures using wavelet transform.
My approach was to pick the most significant n coefficients from each transformed channel, and recording their location. This was done by sorting the list of (power,location) tuples according to abs(power). Similar images will share similarities in that they will have significant coefficients in the same places.
I found it was best to transform in the image into YUV format, which effectively allows you weight similarity in shape (Y channel) and colour (UV channels).
You can in find my implementation of the above in mactorii, which unfortunately I haven't been working on as much as I should have :-)
Another method, which some friends of mine have used with surprisingly good results, is to simply resize your image down to say, a 4x4 pixel and store that are your signature. How similar 2 images are can be scored by say, computing the Manhattan distance between the 2 images, using corresponding pixels. I don't have the details of how they performed the resizing, so you may have to play with the various algorithms available for that task to find one which is suitable.
As a first pass, you can try using color histograms. However, you really need to narrow down your problem domain. Generic image matching is a very hard problem.
Depending on how much accurate results you need, you can simply break the images in n x n pixels blocks and analyze them. If you get different results in the first block you can't stop processing, resulting in some performance improvements.
For analyzing the squares you can for example get the sum of the color values.