Img_hash

Objective-C

@interface Img_hash : NSObject

Swift

class Img_hash : NSObject

The Img_hash module

Member classes: AverageHash, ColorMomentHash, RadialVarianceHash, PHash, ImgHashBase, MarrHildrethHash, BlockMeanHash

Member enums: BlockMeanHashMode

Methods

  • Calculates img_hash::AverageHash in one call

    Declaration

    Objective-C

    + (void)averageHash:(nonnull Mat *)inputArr outputArr:(nonnull Mat *)outputArr;

    Swift

    class func averageHash(inputArr: Mat, outputArr: Mat)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3 or CV_8UC1.

    outputArr

    Hash value of input, it will contain 16 hex decimal number, return type is CV_8U

  • Computes block mean hash of the input image

    Declaration

    Objective-C

    + (void)blockMeanHash:(nonnull Mat *)inputArr
                outputArr:(nonnull Mat *)outputArr
                     mode:(int)mode;

    Swift

    class func blockMeanHash(inputArr: Mat, outputArr: Mat, mode: Int32)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3 or CV_8UC1.

    outputArr

    Hash value of input, it will contain 16 hex decimal number, return type is CV_8U

    mode

    the mode

  • Computes block mean hash of the input image

    Declaration

    Objective-C

    + (void)blockMeanHash:(nonnull Mat *)inputArr
                outputArr:(nonnull Mat *)outputArr;

    Swift

    class func blockMeanHash(inputArr: Mat, outputArr: Mat)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3 or CV_8UC1.

    outputArr

    Hash value of input, it will contain 16 hex decimal number, return type is CV_8U

  • Computes color moment hash of the input, the algorithm is come from the paper “Perceptual Hashing for Color Images Using Invariant Moments”

    Declaration

    Objective-C

    + (void)colorMomentHash:(nonnull Mat *)inputArr
                  outputArr:(nonnull Mat *)outputArr;

    Swift

    class func colorMomentHash(inputArr: Mat, outputArr: Mat)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3 or CV_8UC1.

    outputArr

    42 hash values with type CV_64F(double)

  • Computes average hash value of the input image

    Declaration

    Objective-C

    + (void)marrHildrethHash:(nonnull Mat *)inputArr
                   outputArr:(nonnull Mat *)outputArr
                       alpha:(float)alpha
                       scale:(float)scale;

    Swift

    class func marrHildrethHash(inputArr: Mat, outputArr: Mat, alpha: Float, scale: Float)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input, it will contain 16 hex decimal number, return type is CV_8U

    alpha

    int scale factor for marr wavelet (default=2).

    scale

    int level of scale factor (default = 1)

  • Computes average hash value of the input image

    Declaration

    Objective-C

    + (void)marrHildrethHash:(nonnull Mat *)inputArr
                   outputArr:(nonnull Mat *)outputArr
                       alpha:(float)alpha;

    Swift

    class func marrHildrethHash(inputArr: Mat, outputArr: Mat, alpha: Float)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input, it will contain 16 hex decimal number, return type is CV_8U

    alpha

    int scale factor for marr wavelet (default=2).

  • Computes average hash value of the input image

    Declaration

    Objective-C

    + (void)marrHildrethHash:(nonnull Mat *)inputArr
                   outputArr:(nonnull Mat *)outputArr;

    Swift

    class func marrHildrethHash(inputArr: Mat, outputArr: Mat)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input, it will contain 16 hex decimal number, return type is CV_8U

  • Computes pHash value of the input image

    Declaration

    Objective-C

    + (void)pHash:(nonnull Mat *)inputArr outputArr:(nonnull Mat *)outputArr;

    Swift

    class func pHash(inputArr: Mat, outputArr: Mat)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input, it will contain 8 uchar value

  • Computes radial variance hash of the input image

    Declaration

    Objective-C

    + (void)radialVarianceHash:(nonnull Mat *)inputArr
                     outputArr:(nonnull Mat *)outputArr
                         sigma:(double)sigma
                numOfAngleLine:(int)numOfAngleLine;

    Swift

    class func radialVarianceHash(inputArr: Mat, outputArr: Mat, sigma: Double, numOfAngleLine: Int32)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input

    sigma

    Gaussian kernel standard deviation

    numOfAngleLine

    The number of angles to consider

  • Computes radial variance hash of the input image

    Declaration

    Objective-C

    + (void)radialVarianceHash:(nonnull Mat *)inputArr
                     outputArr:(nonnull Mat *)outputArr
                         sigma:(double)sigma;

    Swift

    class func radialVarianceHash(inputArr: Mat, outputArr: Mat, sigma: Double)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input

    sigma

    Gaussian kernel standard deviation

  • Computes radial variance hash of the input image

    Declaration

    Objective-C

    + (void)radialVarianceHash:(nonnull Mat *)inputArr
                     outputArr:(nonnull Mat *)outputArr;

    Swift

    class func radialVarianceHash(inputArr: Mat, outputArr: Mat)

    Parameters

    inputArr

    input image want to compute hash value, type should be CV_8UC4, CV_8UC3, CV_8UC1.

    outputArr

    Hash value of input