phash

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 11 Imported by: 1

README

phash

A simple perceptual hashing library for golang. Only works for images.

ci.yml Coverage Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DTC

func DTC(img image.Image) (phash uint64)

DTC computes perceptual hash for image using phash dtc image technique.

  1. Reduce size to 32x32
  2. Reduce color to greyscale
  3. Compute the DCT.
  4. Reduce the DCT to 8x8 in order to keep high frequencies.
  5. Compute the median value of 8x8 dtc.
  6. Further reduce the DCT into an uint64.

func FindKeypoints

func FindKeypoints(src image.Image) geometry.Points

FindKeypoints returns a list of points that are interesting/key points It does that by detecting corners using cornerdectect.Fast9

func FromTriangles

func FromTriangles(src image.Image, triangles []triangle.Triangle) []uint64

FromTriangles calculates 3 perceptual hash of src per triangles.

A triangle is transformed into it's equilateral version then we run a DTC on the 3 different angles of the triangle.

When two triangle have the same perceptual hash, it means that the features in the triangle are perceptually similar.

Triangles could come from FindKeypoints or your own library.

This function will start a goroutine per CPU.

Types

This section is empty.

Directories

Path Synopsis
cmd
dtc
rotate90
transformation invariant image phash based on https://github.com/pippy360/transformationInvariantImageSearch
transformation invariant image phash based on https://github.com/pippy360/transformationInvariantImageSearch
tii
transformation invariant image phash based on https://github.com/pippy360/transformationInvariantImageSearch
transformation invariant image phash based on https://github.com/pippy360/transformationInvariantImageSearch

Jump to

Keyboard shortcuts

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