Dhash
This crate allows a dhash
signature to be constructed from an image.
Requires the image
crate
A dhash
is a differential gradient hash that compares the difference in gradient between adjacent pixels, and provides a 64 bit signature of an image.
A dhash
can be used to compare against other images for similarity and is resilient to differences in:
- Aspect Ratio
- Image Size
- Brightness and Contrast
Implementation details taken from the Kind of Like That blog
Usage (CLI)
Install this crate:
Run dhash <img1>
to print out a dhash
of the image at path img1
Run dhash <img1> <img2>
to print out a dhash
of both images and the distance between them (a lower number is closer):