imghash

package module
v0.0.0-...-18af325 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 10 Imported by: 0

README

imghash

A package that implements image hashing algorithms in Go.

Dependencies

  • go-fourier package.

    go get github.com/ardabasaran/go-fourier

Documentation

Index

Constants

This section is empty.

Variables

View Source
var INTERP = resize.Bicubic

Functions

func Ahash

func Ahash(img *image.Image) uint64

Ahash calculates a hash value for the given image. It implements the Average hash algorithm as explained here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html Returns the hash of the image in 64 bits integer.

func Dhash

func Dhash(img *image.Image) uint64

Dhash calculates a hash value for the given image. It implements the dHash (gradient) algorithm as explained here: http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html Returns the hash of the image in 64 bits integer.

func HammingDistance

func HammingDistance(d1, d2 uint64) uint64

func Phash

func Phash(img *image.Image) uint64

Phash calculates a hash value for the given image. It implements the pHash algorithm as explained here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html Returns the hash of the image in 64 bits integer.

Types

type ImageHashPair

type ImageHashPair struct {
	Filename string
	Image    image.Image
	Hash     uint64
}

type ImageSlice

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL