transforms

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 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 DCT2D

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

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

func DCT2DHash256 added in v0.2.0

func DCT2DHash256(input *[]float64) [256]float64

DCT2DHash256 function returns a result of DCT2D by using the seperable property. DCT type II, unscaled. Algorithm by Byeong Gi Lee, 1984. Cusstom built for Hash256. Returns flattened pixels

func DCT2DHash64 added in v0.2.0

func DCT2DHash64(input *[]float64) [64]float64

DCT2DHash64 function returns a result of DCT2D by using the seperable property. DCT type II, unscaled. Algorithm by Byeong Gi Lee, 1984. Cusstom built for Hash64. Returns flattened pixels

func FlattenPixels

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

FlattenPixels function flattens 2d array into 1d array.

func LinearTosRGB added in v0.2.0

func LinearTosRGB(value float64) int

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 MedianOfPixels256 added in v0.2.0

func MedianOfPixels256(pixels []float64) float64

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

func MedianOfPixels64 added in v0.2.0

func MedianOfPixels64(pixels []float64) float64

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

func OldYCbCR2Gray added in v0.2.0

func OldYCbCR2Gray(colorImg *image.YCbCr, pixels []float64, s int)

OldYCbCR2Gray uses *image.YCbCr which is signifiantly faster than the image.Image interface.

func PixelYCnCRGray added in v0.2.0

func PixelYCnCRGray(img *image.YCbCr, pixels []float64)

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.

func SRGBToLinear added in v0.2.0

func SRGBToLinear(value int) float64

func SignPow added in v0.2.0

func SignPow(value, exp float64) float64

func YCbCR2Gray added in v0.2.0

func YCbCR2Gray(colorImg *image.YCbCr, pixels []float64)

YCbCR2Gray uses *image.YCbCr which is signifiantly faster than the image.Image interface.

Types

This section is empty.

Jump to

Keyboard shortcuts

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