/// <summary> /// Release all the unmanaged resource associated with MarrHildrethHash /// </summary> protected override void DisposeObject() { if (_ptr != IntPtr.Zero) { ImgHashInvoke.cveMarrHildrethHashRelease(ref _ptr, ref _sharedPtr); } base.DisposeObject(); }
/// <summary> /// Release all the unmanaged resource associated with RadialVarianceHash /// </summary> protected override void DisposeObject() { if (_ptr != IntPtr.Zero) { ImgHashInvoke.cveRadialVarianceHashRelease(ref _ptr, ref _sharedPtr); } base.DisposeObject(); }
/// <summary> /// Compare the hash value between inOne and inTwo /// </summary> /// <param name="hashOne">Hash value one</param> /// <param name="hashTwo">Hash value two</param> /// <returns>indicate similarity between inOne and inTwo, the meaning of the value vary from algorithms to algorithms</returns> public double Compare(IInputArray hashOne, IInputArray hashTwo) { using (InputArray iaHashOne = hashOne.GetInputArray()) using (InputArray iaHashTwo = hashTwo.GetInputArray()) { return(ImgHashInvoke.cveImgHashBaseCompare(_imgHashBase, iaHashOne, iaHashTwo)); } }
/// <summary> /// Release all the unmanaged resource associated with ColorMomentHash /// </summary> protected override void DisposeObject() { if (_ptr != IntPtr.Zero) { ImgHashInvoke.cveColorMomentHashRelease(ref _ptr); } base.DisposeObject(); }
/// <summary> /// Computes hash of the input image /// </summary> /// <param name="inputArr">input image to compute hash value</param> /// <param name="outputArr">hash of the image</param> public void Compute(IInputArray inputArr, IOutputArray outputArr) { using (InputArray iaInputArr = inputArr.GetInputArray()) using (OutputArray oaOutputArr = outputArr.GetOutputArray()) { ImgHashInvoke.cveImgHashBaseCompute(_imgHashBase, iaInputArr, oaOutputArr); } }
/// <summary> /// Create a Marr-Hildreth operator based hash. /// </summary> /// <param name="alpha">Scale factor for marr wavelet.</param> /// <param name="scale">Level of scale factor</param> public MarrHildrethHash(float alpha = 2.0f, float scale = 1.0f) { _ptr = ImgHashInvoke.cveMarrHildrethHashCreate(ref _imgHashBase, alpha, scale, ref _sharedPtr); }
/// <summary> /// Create an average hash object. /// </summary> public AverageHash() { _ptr = ImgHashInvoke.cveAverageHashCreate(ref _imgHashBase, ref _sharedPtr); }
/// <summary> /// Create a PHash object /// </summary> public PHash() { _ptr = ImgHashInvoke.cvePHashCreate(ref _imgHashBase, ref _sharedPtr); }
/// <summary> /// Create an image hash based on Radon transform /// </summary> /// <param name="sigma">Sigma</param> /// <param name="numOfAngleLine">Number of angle line</param> public RadialVarianceHash(double sigma = 1, int numOfAngleLine = 180) { _ptr = ImgHashInvoke.cveRadialVarianceHashCreate(ref _imgHashBase, sigma, numOfAngleLine, ref _sharedPtr); }
/// <summary> /// Create a Color Moment Hash object /// </summary> public ColorMomentHash() { _ptr = ImgHashInvoke.cveColorMomentHashCreate(ref _imgHashBase); }
/// <summary> /// Create a Block Mean Hash object /// </summary> /// <param name="mode">The hash mode</param> public BlockMeanHash(Mode mode = Mode.HashMode0) { _ptr = ImgHashInvoke.cveBlockMeanHashCreate(ref _imgHashBase, mode, ref _sharedPtr); }
/// <summary> /// Create a PHash object /// </summary> public PHash() { _ptr = ImgHashInvoke.cvePHashCreate(ref _imgHashBase); }
/// <summary> /// Create a Color Moment Hash object /// </summary> public ColorMomentHash() { _ptr = ImgHashInvoke.cveColorMomentHashCreate(ref _imgHashBase, ref _sharedPtr); }
/// <summary> /// Create an average hash object. /// </summary> public AverageHash() { _ptr = ImgHashInvoke.cveAverageHashCreate(ref _imgHashBase); }