Sunday, 21 April 2019

Using OpenCV's Image Hashing Module from Python

I want to use OpenCV's perceptual hashing functions from Python.

This isn't working.

import cv2
a_1 = cv2.imread('a.jpg')
cv2.img_hash_BlockMeanHash.compute(a_1)

I get:

TypeError: descriptor 'compute' requires a 'cv2.img_hash_ImgHashBase' object but received a 'numpy.ndarray'

And this is failing too

a_1_base = cv2.img_hash_ImgHashBase(a_1) 
cv2.img_hash_BlockMeanHash.compute(a_1_base)

I get:

TypeError: Incorrect type of self (must be 'img_hash_ImgHashBase' or its derivative)

Colab notebook showing this:

https://colab.research.google.com/drive/1x5ZxMBD3wFts2WKS4ip3rp4afDx0lGhi



from Using OpenCV's Image Hashing Module from Python

No comments:

Post a Comment