transforms

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package transforms provides the transformations for imagehash

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 DCT1DFast

func DCT1DFast(input []float64) []float64

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

func DCT1DFast64

func DCT1DFast64(input []float64)

func DCT2D

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

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

func DCT2DFast

func DCT2DFast(input *[]float64)

DCT2DFast function returns a result of DCT2D by using the seperable property. Fast version only works with pHashSize 64 will panic if another since is given.

func FlattenPixels

func FlattenPixels(pixels [][]float64, x int, y int) []float64

FlattenPixels function flattens 2d array into 1d array.

func FlattenPixelsFast64

func FlattenPixelsFast64(pixels []float64, x int, y int) []float64

FlattenPixelsFast64 function flattens pixels array from DCT2D into [64]float array.

func MeanOfPixels

func MeanOfPixels(pixels []float64) float64

MeanOfPixels function returns a mean of pixels.

func MedianOfPixels

func MedianOfPixels(pixels []float64) float64

MedianOfPixels function returns a median value of pixels. It uses quick selection algorithm.

func MedianOfPixelsFast

func MedianOfPixelsFast(pixels []float64) float64

MedianOfPixelsFast function returns a median value of pixels. It uses quick selection algorithm.

func Rgb2Gray

func Rgb2Gray(colorImg image.Image) [][]float64

Rgb2Gray function converts RGB to a gray scale array.

func Rgb2GrayFast

func Rgb2GrayFast(colorImg image.Image, pixels *[]float64)

Rgb2GrayFast function converts RGB to a gray scale array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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