phash

package module
v0.0.0-...-9e959c7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

README

based on phash algorithm

import "github.com/Stasenko-Konstantin/phash"

hash1, err := phash.Hash("path/to/img1")
if err != nil { ... }
hash2, err := phash.Hash("path/to/img2")
if err != nil { ... }
if phash.Distance(hash1, hash2) > phash.MinDistance {
	... // rm imgs or smth else
}

Documentation

Index

Constants

View Source
const (
	MinDistance int = 3
)

Variables

This section is empty.

Functions

func Distance

func Distance(hash1, hash2 []byte) int

func Hash

func Hash(imgPath string) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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