java.lang.Object
com.github.hypfvieh.imaging.ImageCompare
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalcHammingDistance(String _left, String _right) Calculate the hamming distance of the two given strings.static intcompareWith(IImgHash _hasher, File _img1, File _img2) Calculate hashes for _img1 and _img2 using _hasher and return the hamming distance as result.
-
Constructor Details
-
ImageCompare
public ImageCompare()
-
-
Method Details
-
compareWith
Calculate hashes for _img1 and _img2 using _hasher and return the hamming distance as result.- Parameters:
_hasher- hash implemenation to use_img1- first image_img2- second image- Returns:
- distance score
-
calcHammingDistance
Calculate the hamming distance of the two given strings. String must have the same length!For further explanation about the Hamming Distance, take a look at its Wikipedia page at http://en.wikipedia.org/wiki/Hamming_distance.
- Parameters:
_left- first checksum_right- second checksum- Returns:
- distance score
- Throws:
IllegalArgumentException- if strings do not have same lengthNullPointerException- if either _left or _right string is null
-