images

package
v1.22.21 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Zlib Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DCT1D

func DCT1D(input []float64) []float64

DCT1D function returns result of DCT-II. DCT type II, unscaled. Algorithm by Byeong Gi Lee, 1984.

func DCT2D

func DCT2D(input [][]float64, w int, h int) [][]float64

DCT2D function returns a result of DCT2D by using the seperable property.

Types

type Histogram

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

Histogram 相似图片识别(直方图)

func NewHistogram

func NewHistogram() *Histogram

func (*Histogram) Data

func (hm *Histogram) Data() []float64

func (*Histogram) Match

func (hm *Histogram) Match(dest *Histogram) float64

Match 返回值大于等于0.8可以简单判断这两张图片内容一致

func (*Histogram) Open

func (hm *Histogram) Open(reader io.Reader) error

func (*Histogram) OpenFile

func (hm *Histogram) OpenFile(filename string) error

func (*Histogram) OpenImage

func (hm *Histogram) OpenImage(img image.Image) error

type PHash

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

PHash 感知哈希算法, 值越小相识度越高,10之内可以简单判断这两张图片内容一致

func NewPHash

func NewPHash() *PHash

func NewPHashBy

func NewPHashBy(size int, smallerSize int) *PHash

func (*PHash) Match

func (hash *PHash) Match(dest *PHash) int

Match 值越小相识度越高,10之内可以简单判断这两张图片内容一致

func (*PHash) Open

func (hash *PHash) Open(reader io.Reader) error

func (*PHash) OpenFile

func (hash *PHash) OpenFile(filename string) error

func (*PHash) OpenImage

func (hash *PHash) OpenImage(img image.Image) error

func (*PHash) String

func (hash *PHash) String() string

Returns a 'binary string' (like. 001010111011100010) which is easy to do a hamming distance on.

Jump to

Keyboard shortcuts

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