Class DHash
- java.lang.Object
-
- com.crawljax.stateabstractions.visual.imagehashes.DHash
-
public class DHash extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description DHash()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Integerdistance(String h1, String h2)Calculate the Hamming distance between two hashesStringgetDHash(BufferedImage image)StringgetDHash(String imgPath)StringgetDHash(org.opencv.core.Mat objectImage)booleanimagesPerceptuallySimilar(BufferedImage img1, BufferedImage img2)booleanimagesPerceptuallySimilar(String img1, String img2)compares the DHash of two images and return whether they are perceptually similar (max 10 different pixels allowed)booleanimagesPerceptuallySimilar(String img1, String img2, int threshold)compares the DHash of two images and return whether they are perceptually similar (max
-
-
-
Method Detail
-
distance
public static Integer distance(String h1, String h2)
Calculate the Hamming distance between two hashes- Parameters:
h1-h2-- Returns:
-
getDHash
public String getDHash(org.opencv.core.Mat objectImage)
-
getDHash
public String getDHash(BufferedImage image) throws IOException
- Throws:
IOException
-
imagesPerceptuallySimilar
public boolean imagesPerceptuallySimilar(String img1, String img2)
compares the DHash of two images and return whether they are perceptually similar (max 10 different pixels allowed)- Parameters:
img1-img2-- Returns:
- true/false
-
imagesPerceptuallySimilar
public boolean imagesPerceptuallySimilar(BufferedImage img1, BufferedImage img2) throws IOException
- Throws:
IOException
-
-