Class HogHashAngularEncoded

  • All Implemented Interfaces:
    Serializable

    public class HogHashAngularEncoded
    extends HogHash
    Deprecated.
    not ready to use yet
    Since:
    2.0.0
    Author:
    Kilian
    See Also:
    Serialized Form
    • Constructor Detail

      • HogHashAngularEncoded

        public HogHashAngularEncoded​(int bitResolution)
        Deprecated.
        * Create a hog hasher with the target bit resolution. Default values of 4 bins per cell (0°,45°,90°,135°) and a cell width of 2 pixels per cell are assumed.
        Parameters:
        bitResolution - the bit resolution of the final hash. The hash will be at least the specified bits but may be bigger due to algorithmic constraints. The best attempt is made to return a hash with the given number of bits.
      • HogHashAngularEncoded

        public HogHashAngularEncoded​(int width,
                                     int height,
                                     int cellWidth,
                                     int numBins)
        Deprecated.
        Create a hog hasher with parameters specific to the hog feature detection algorithm. The actual hash will have a key length of (width / cellWidth) * (height / cellWidth) * numBins
        Parameters:
        width - of the rescaled image
        height - of the rescaled image
        cellWidth - the width and height of sub cell. For each cell a gradient will be computed. The cell width has to be a divisor of width AND height!
        numBins - the number of bins per cell. The number of bins represent the angular granularity the gradients will be sorted into. The gradients will be sorted into buckets equivalent of the size of 180°/numBins
        Throws:
        IllegalArgumentException - if width or height can't be divided by cellWidth or if any of the arguments is smaller or equal 0
    • Method Detail

      • hash

        protected BigInteger hash​(BufferedImage image,
                                  HashBuilder hash)
        Deprecated.
        Description copied from class: HashingAlgorithm
        Calculate a hash for the given image. Invoking the hash function on the same image has to return the same hash value. A comparison of the hashes relates to the similarity of the images. The lower the value the more similar the images are. Equal images will produce a similarity of 0.

        This method is intended to be overwritten by implementations and takes a baseHash argument to allow concatenating multiple hashes as well to be able to compute the effective hash length in HashingAlgorithm.getKeyResolution(). Preceding 0's are omitted in big integer objects, while the usual hamming distance can be calculated due to xoring without issue the normalized distance requires the potential length of the key to be known.

        Overrides:
        hash in class HogHash
        Parameters:
        image - Image whose hash will be calculated
        hash - a hash builder used to construct the hash
        Returns:
        the hash encoded as a big integer