Documentation ¶
Index ¶
- type ExtImageHash
- func ExtAverageHash(img image.Image, width, height int) (*ExtImageHash, error)
- func ExtDifferenceHash(img image.Image, width, height int) (*ExtImageHash, error)
- func ExtImageHashFromString(s string) (*ExtImageHash, error)deprecated
- func ExtPerceptionHash(img image.Image, width, height int) (*ExtImageHash, error)
- func LoadExtImageHash(b io.Reader) (*ExtImageHash, error)
- func NewExtImageHash(hash []uint64, kind Kind, bits int) *ExtImageHash
- type ImageHash
- func AverageHash(img image.Image) (*ImageHash, error)
- func DifferenceHash(img image.Image) (*ImageHash, error)
- func ImageHashFromString(s string) (*ImageHash, error)deprecated
- func LoadImageHash(b io.Reader) (*ImageHash, error)
- func NewImageHash(hash uint64, kind Kind) *ImageHash
- func PerceptionHash(img image.Image) (*ImageHash, error)
- func PerceptionHash32(img image.Image) (*ImageHash, error)
- type Kind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtImageHash ¶
type ExtImageHash struct {
// contains filtered or unexported fields
}
ExtImageHash is a struct of big hash computation.
func ExtAverageHash ¶
func ExtAverageHash(img image.Image, width, height int) (*ExtImageHash, error)
ExtAverageHash function returns ahash of which the size can be set larger than uint64 Support 64bits ahash (width=8, height=8) and 256bits ahash (width=16, height=16)
func ExtDifferenceHash ¶
func ExtDifferenceHash(img image.Image, width, height int) (*ExtImageHash, error)
ExtDifferenceHash function returns dhash of which the size can be set larger than uint64 Support 64bits dhash (width=8, height=8) and 256bits dhash (width=16, height=16)
func ExtImageHashFromString
deprecated
func ExtImageHashFromString(s string) (*ExtImageHash, error)
ExtImageHashFromString returns a big hash from a hex representation
Deprecated: Use goimagehash.LoadExtImageHash instead.
func ExtPerceptionHash ¶
func ExtPerceptionHash(img image.Image, width, height int) (*ExtImageHash, error)
ExtPerceptionHash function returns phash of which the size can be set larger than uint64 Some variable name refer to https://github.com/JohannesBuchner/imagehash/blob/master/imagehash/__init__.py Support 64bits phash (width=8, height=8) and 256bits phash (width=16, height=16) Important: width * height should be the power of 2
func LoadExtImageHash ¶
func LoadExtImageHash(b io.Reader) (*ExtImageHash, error)
LoadExtImageHash method loads a ExtImageHash from io.Reader.
func NewExtImageHash ¶
func NewExtImageHash(hash []uint64, kind Kind, bits int) *ExtImageHash
NewExtImageHash function creates a new big hash
func (*ExtImageHash) Bits ¶
func (h *ExtImageHash) Bits() int
Bits method returns an actual hash bit size
func (*ExtImageHash) Distance ¶
func (h *ExtImageHash) Distance(other *ExtImageHash) (int, error)
Distance method returns a distance between two big hashes
func (*ExtImageHash) Dump ¶
func (h *ExtImageHash) Dump(w io.Writer) error
Dump method writes a binary serialization into w io.Writer.
func (*ExtImageHash) GetHash ¶
func (h *ExtImageHash) GetHash() []uint64
GetHash method returns a big hash value
func (*ExtImageHash) GetKind ¶
func (h *ExtImageHash) GetKind() Kind
GetKind method returns a kind of big hash
func (*ExtImageHash) ToString ¶
func (h *ExtImageHash) ToString() string
ToString returns a hex representation of big hash
type ImageHash ¶
type ImageHash struct {
// contains filtered or unexported fields
}
ImageHash is a struct of hash computation.
func AverageHash ¶
AverageHash fuction returns a hash computation of average hash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
func DifferenceHash ¶
DifferenceHash function returns a hash computation of difference hash. Implementation follows http://www.hackerfactor.com/blog/?/archives/529-Kind-of-Like-That.html
func ImageHashFromString
deprecated
func LoadImageHash ¶
LoadImageHash method loads a ImageHash from io.Reader.
func NewImageHash ¶
NewImageHash function creates a new image hash.
func PerceptionHash ¶
PerceptionHash function returns a hash computation of phash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
func PerceptionHash32 ¶
PerceptionHash32 function returns a hash computation of phash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html