PerceptualHash class
Algorithm class for comparing images with the perceptual hash method
Images are grayscaled and resized to 32x32. Then they are passed through a 1-dimension discrete cosine transformation. The top 8x8 is only accounted for since it gives the generalized frequency of the image. With this, a hash is created.
- Applications in digital forensics, copyright protection, and media file search
- 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
- PerceptualHash
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
-
average(
List pixels) → num - Helper funciton to compute the average of an array after dct caclulations
-
calcPhash(
List pixelList) → String - Helper function which computes a binary hash of a List of Pixel
-
calculateDCT(
List matrix) → List - Helper function to perform 1D discrete cosine tranformation on a matrix
-
compare(
Image src1, Image src2) → double -
Resize and grayscale images
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
unit8ListToMatrix(
List pixelList) → List - Helper function to convert a Unit8List to a nD matrix
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited