PixelMatching class

Algorithm class for comparing images with standard pixel matching.

Images are resized to the same dimensions (if dimensions don't match) and each src1 pixel's RGB value is checked to see if it falls within 5% (of 256) of src2 pixel's RGB value.

  • Best with images of similar aspect ratios and dimensions
  • Compare for exactness (if two images are identical)
  • Returns percentage diffence (0.0 - no difference, 1.0 - 100% difference)
Inheritance

Constructors

PixelMatching({bool ignoreAlpha = false, dynamic tolerance = 0.05})

Properties

hashCode int
The hash code for this object.
no setterinherited
ignoreAlpha ↔ dynamic
Ignores alpha channel when computing difference
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tolerance ↔ dynamic
Percentage tolerance value between 0.0 and 1.0 of the range of RGB values, 256, used when directly comparing pixels for equivalence.
getter/setter pair

Methods

compare(Image src1, Image src2) double
Computes overlap between two images's color intensities. Return value is the fraction similarity e.g. 0.1 means 10%
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