Documentation ¶
Overview ¶
Package fingerprint provides fingerprinting of images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BMVDelta ¶
BMVDelta returns the difference between the two block mean value hashes h and g. The difference is in the range [0,1] with 0 for identical hashes and 1 for maximal different hashes (i.e. a Hamming distance of 64). The lowest significant difference in BMVHashes is 2 bits corrsponding to a delta of 2/64 = 0.03125.
func ColorHistDelta ¶
ColorHistDelta returns the difference between the two color histograms h and g. The difference is in the range [0,1] with 0 for identical color histograms and 1 for maximal different histograms.
Types ¶
type BMVHash ¶
type BMVHash uint64
BMVHash is the 64 bit block mean value hash of an image. The following references contain more information: Di Wu, Xuebing Zhou, and Xiamu Niu. 2009. A novel image hash algorithm resistant to print-scan. Signal Process. 89, 12 (December 2009), 2415-2424. As described in Christoph Zauner: "Implementation and Benchmarking of Perceptual Image Hash Functions" DIPLOMARBEIT, FH Hagenberg, Juli 2010.
func BMVHashFromString ¶
BMVHashFromString parses the hexadecimal number in s and panics if s cannot be parsed to a uint64.
func NewBMVHash ¶
NewBMVHash computes the block mean value hash of img. The following degenerate case return special values:
- If one or both dimensions of the image are < 8 then BMV hash of 0 (i.e. 64 0s) is returned.
- If one dimension is smaller than 16 a fingerprint of 64 1s is returned.
func (BMVHash) HammingDistance ¶
HammingDistance returns the Hammig distance between the bit strings of h and g.
type ColorHist ¶
type ColorHist [24]byte
ColorHist is a normalized color histogram based on the colors from the Greta Mecbeth Color Picker.
func ColorHistFromString ¶
ColorHistFromString converts 24 hex digits to a ColorHist.
func NewColorHist ¶
NewColorHist computest the color histogram of img.