Class TypedImageMatcher

    • Constructor Detail

      • TypedImageMatcher

        public TypedImageMatcher()
    • Method Detail

      • addHashingAlgorithm

        public void addHashingAlgorithm​(HashingAlgorithm algo,
                                        double threshold)
        Append a new hashing algorithm which will be executed after all hash algorithms passed the test.

        The same algorithm may only be added once. Attempts to add an identical algorithm will instead update the settings of the old instance.

        This method assumes the normalized hamming distance. If the definite distance shall be used take a look at addHashingAlgorithm(HashingAlgorithm, double, boolean)

        Parameters:
        algo - The algorithms to be added
        threshold - maximum normalized hamming distance between hashes in order to pass as identical image
      • addHashingAlgorithm

        public void addHashingAlgorithm​(HashingAlgorithm algo,
                                        double threshold,
                                        boolean normalized)
        Append a new hashing algorithm which will be executed after all hash algorithms passed the test.

        The same algorithm may only be added once to an image hasher. Attempts to add an identical algorithm will instead update the settings of the old instance.

        Parameters:
        algo - The algorithms to be added
        threshold - the threshold the hamming distance may be in order to pass as identical image.
        normalized - Weather the normalized or default hamming distance shall be used. The normalized hamming distance will be in range of [0-1] while the hamming distance depends on the length of the hash
      • removeHashingAlgo

        public boolean removeHashingAlgo​(HashingAlgorithm algo)
        Removes the hashing algorithms from the image matcher.
        Parameters:
        algo - the algorithm to be removed
        Returns:
        true if the algorithms was removed, false otherwise
      • clearHashingAlgorithms

        public void clearHashingAlgorithms()
        Remove all hashing algorithms used by this image matcher instance. At least one algorithm has to be supplied before imaages can be checked for similarity
      • getAlgorithms

        public Map<HashingAlgorithm,​TypedImageMatcher.AlgoSettings> getAlgorithms()
        Return an immutable map copy of the algorithms currently used in the matcher. This map is a hard copy of the hashmap and does not updated if the underlying collection gets altered
        Returns:
        A map containing all algorithms used in this matcher
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object