AverageHash class

Algorithm class for comparing images using average values of pixels.

Images are resized to 8x8 and grayscaled. Afterwards, this algorithm finds the average pixel value by getting the sum of all pixel values and dividing by total number of pixels. Then, each pixel is checked against the actual value and average value. A binary string is created which is converted to a hex hash.

  • Work well with images of any dimension and aspect ratio
  • Comparing image fingerprints
  • Images can be rotated
  • Does not handle transparent pixels
  • Returns percentage diffence (0.0 - no difference, 1.0 - 100% difference)
Inheritance

Constructors

AverageHash()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calcAvg(List pixelList) String
Helper funciton to compute average hex hash for an image
compare(Image src1, Image src2) double
Creates lists of Pixel for src1 and src2 for sub class compare operations
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited