Documentation ¶
Overview ¶
Package imgsim is a library allows you to compute a fast perceptual hashes of an image. These hashes can then be used to compare images for similarity. Similar looking images will get similar perceptual hashes, unlike cryptographic hashes that would be very different for images with slight differences. This makes them suitable to measure how similar images are.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hash ¶
type Hash uint64
Hash contains the perceptual hash stored as bits in a 64 bit unsigned integer.
func AverageHash ¶
AverageHash calculates the average hash of an image. First the image is resized to 8x8. Then it is converted to grayscale. Lastly the average hash is computed.
func DifferenceHash ¶
DifferenceHash calculates the average hash of an image. First the image is converted to grayscale Then it is resized to 9x8. Lastly the average hash is computed.