MedianHash class
Algorithm class for comparing images using average values of pixels.
Images are resized to 9x8 and grayscaled. Afterwards, this algorithm finds the median pixel value. Then, each pixel is checked against the actual value and median value. A binary string is created and converted to a hex hash.
- Works 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
-
- Object
- Algorithm
- HashAlgorithm
- MedianHash
Constructors
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
-
calcMedian(
List pixelList) → String - Helper funciton to compute median hex hash for an image
-
compare(
Image src1, Image src2) → double -
Creates lists of Pixel for
src1
andsrc2
for sub class compare operationsoverride -
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