Image hash for very similar images

I take screenshots of the application and try to determine if there was an exact image before. I am looking to define trivial changes as different - for example. if the image has text, and spelling changes that are considered inconsistencies.

I successfully used the MD5 hash of the contents of the image on the screen to search the database for known images and discovered if this had happened before.

Now I have ported it to another machine, and despite my attempts to accurately match the configurations, I always get slightly different images for the old machine. When I say different, changes are minutes โ€” if I blow up old and new images and shake between them, I donโ€™t see any difference! However, the ImageMagick compare command can see a small number of pixels that are different from each other.

So my MD5 hashes no longer match. Instead of a simple MD5 hash, I need an image hash .

Carrying out my research, I found that most image hashes try to be quite generous - they accept altered, transformed and watermarks with corresponding false-positive matches. I want the hash image to be much more strict - only changes that are minor color changes are possible.

Can anyone recommend a library or image hashing algorithm? (Not an application, such as dupdetector ).

Remember: my requirements differ from many similar questions in that I do not want a liberal algorithm, for example, to shrink or pHash , and I do not need a comparison tool, for example, structural similarity or Compare ImageMagick .

I want a hash that makes very similar images to give the same hash value. Is it possible?

+6
source share
1 answer

You can take a look at the next article entitled "Spectral Hashing." This is an algorithm that is designed to create hash codes from images to group similar images (see Examples of extraction at the end of the article). This is a good starting point.

Link: http://www.cs.huji.ac.il/~yweiss/SpectralHashing/

+1
source

Source: https://habr.com/ru/post/913785/


All Articles