2 ms·
There are hash algorithms for image similarity. For a toy example, imagine scaling the image to 8x8px, making it grayscale, and using those 64 bytes as hash. Th
by wongarsu 4y ago
There are hash algorithms for image similarity. For a toy example, imagine scaling the image to 8x8px, making it grayscale, and using those 64 bytes as hash. That way you only have to hash each picture once, and can find duplicates by searching for hashes with a low hamming distance (number of bit flips) to each other, which is very fast.
Of course actual hash algorithms are a bit cleverer, there are a number to choose from depending on what you want to consider a duplicate (cropping, flips, rotations, etc)
- ClassyJacket 4y agoBut even a single pixel being one shade brighter would make one hash completely different, that's the point of hashes.
- fjkdlsjflkds 4y agoYou're probably confusing "cryptographic hash functions" with "perceptual hashing" (or other forms of "locality-sensitive hashing"). In the case of the latter, what you say is almost always not true (that's the point of using "perceptual hashing" after all: similar objects get mapped to similar/same hash). See: https://en.wikipedia.org/wiki/Perceptual_hashing https://en.wikipedia.org/wiki/Perceptual_hashing