Reputation: 25470
I want to compare an image against a database of images to find any "similar" images (it could be the same image but resized, lossy compressed, slightly cropped) with a defined tolerance criteria.
Both the size (hundreds of thousands of images to compare against) and the criteria (resizing, cropping) rule out using any kind of pixel to pixel comparison. What I have to do is compute and store a "hash" of each image, and then when I want to compare a new image, I calculate its hash and do a search with that.
I understand the basics for how this is generally done - you identify a small number of unique "features" in an image (I've played a bit with identifying corners) and store that information as the hash. However this will not be a major component of the project I'm working on, so I can't take the time to develop and test something of this scale from scratch.
Are there any (.NET preferably) libraries for generating and comparing visual image hashes? Something along the line of string ComputeHash(Image)
and int GetHashDifference(string, string)
Upvotes: 1
Views: 377
Reputation: 10030
Take a look at this SourceForge project: Image Similarity Tool. It's a command-line Linux tool, but perhaps some of the techniques used in it might be useful to you.
imgSeek, a collection of free (open source) image similarity projects, may also be of use to you.
Unfortunately I wasn't able to find any .NET libraries that do exactly what you need, but maybe someone else will be able to help you there.
Good luck!
Upvotes: 1