goimagehash: github.com/corona10/goimagehash Index | Files | Directories

package goimagehash

import "github.com/corona10/goimagehash"

Index

Package Files

doc.go hashcompute.go imagehash.go imagehash19.go

type ExtImageHash Uses

type ExtImageHash struct {
    // contains filtered or unexported fields
}

ExtImageHash is a struct of big hash computation.

func ExtAverageHash Uses

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 Uses

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 Uses

func ExtImageHashFromString(s string) (*ExtImageHash, error)

ExtImageHashFromString returns a big hash from a hex representation

Deprecated: Use goimagehash.LoadExtImageHash instead.

func ExtPerceptionHash Uses

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 Uses

func LoadExtImageHash(b io.Reader) (*ExtImageHash, error)

LoadExtImageHash method loads a ExtImageHash from io.Reader.

func NewExtImageHash Uses

func NewExtImageHash(hash []uint64, kind Kind, bits int) *ExtImageHash

NewExtImageHash function creates a new big hash

func (*ExtImageHash) Bits Uses

func (h *ExtImageHash) Bits() int

Bits method returns an actual hash bit size

func (*ExtImageHash) Distance Uses

func (h *ExtImageHash) Distance(other *ExtImageHash) (int, error)

Distance method returns a distance between two big hashes

func (*ExtImageHash) Dump Uses

func (h *ExtImageHash) Dump(w io.Writer) error

Dump method writes a binary serialization into w io.Writer.

func (*ExtImageHash) GetHash Uses

func (h *ExtImageHash) GetHash() []uint64

GetHash method returns a big hash value

func (*ExtImageHash) GetKind Uses

func (h *ExtImageHash) GetKind() Kind

GetKind method returns a kind of big hash

func (*ExtImageHash) ToString Uses

func (h *ExtImageHash) ToString() string

ToString returns a hex representation of big hash

type ImageHash Uses

type ImageHash struct {
    // contains filtered or unexported fields
}

ImageHash is a struct of hash computation.

func AverageHash Uses

func AverageHash(img image.Image) (*ImageHash, error)

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 Uses

func DifferenceHash(img image.Image) (*ImageHash, error)

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 Uses

func ImageHashFromString(s string) (*ImageHash, error)

ImageHashFromString returns an image hash from a hex representation

Deprecated: Use goimagehash.LoadImageHash instead.

func LoadImageHash Uses

func LoadImageHash(b io.Reader) (*ImageHash, error)

LoadImageHash method loads a ImageHash from io.Reader.

func NewImageHash Uses

func NewImageHash(hash uint64, kind Kind) *ImageHash

NewImageHash function creates a new image hash.

func PerceptionHash Uses

func PerceptionHash(img image.Image) (*ImageHash, error)

PerceptionHash function returns a hash computation of phash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html

func (*ImageHash) Bits Uses

func (h *ImageHash) Bits() int

Bits method returns an actual hash bit size

func (*ImageHash) Distance Uses

func (h *ImageHash) Distance(other *ImageHash) (int, error)

Distance method returns a distance between two hashes.

func (*ImageHash) Dump Uses

func (h *ImageHash) Dump(w io.Writer) error

Dump method writes a binary serialization into w io.Writer.

func (*ImageHash) GetHash Uses

func (h *ImageHash) GetHash() uint64

GetHash method returns a 64bits hash value.

func (*ImageHash) GetKind Uses

func (h *ImageHash) GetKind() Kind

GetKind method returns a kind of image hash.

func (*ImageHash) ToString Uses

func (h *ImageHash) ToString() string

ToString returns a hex representation of the hash

type Kind Uses

type Kind int

Kind describes the kinds of hash.

const (
    // Unknown is a enum value of the unknown hash.
    Unknown Kind = iota
    // AHash is a enum value of the average hash.
    AHash
    //PHash is a enum value of the perceptual hash.
    PHash
    // DHash is a enum value of the difference hash.
    DHash
    // WHash is a enum value of the wavelet hash.
    WHash
)

Directories

PathSynopsis
etcs
_examples
transforms

Package goimagehash imports 11 packages (graph) and is imported by 12 packages. Updated 2020-02-11. Refresh now. Tools for package owners.