Class DHash


  • public class DHash
    extends Object
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
    • Constructor Detail

      • DHash

        public DHash()
    • 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)
      • 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​(String img1,
                                                 String img2,
                                                 int threshold)
        compares the DHash of two images and return whether they are perceptually similar (max
        Parameters:
        img1 -
        img2 -
        threshold -
        Returns:
        true/false for threshold different pixels allowed)