pair

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Image1 image.Image
	Image2 image.Image
	Score  float64
	Time   float64
}

Pair is a construct of 2 images to be compared, along with Score and time taken for comparison Score is a value between 0 to 1 indicating similarity of images. 0 indicates the images are identical, 1 indicates images are of different sizes

func NewImagePair

func NewImagePair(image1Path, image2Path string) (*Pair, error)

func (*Pair) Compare

func (p *Pair) Compare()

Compare uses simple pixel based comparison to determine similarity between images. If the images are of different sizes, they are considered different with a Score of 1. Red, Green and Blue values of each pixel is compared to calculate the difference in pixel. Ratio of the sum of all pixel differences and Total no of pixels is user to determine the Score

Jump to

Keyboard shortcuts

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