我想从 Python中使用 OpenCV 的感知散列函数。
这是行不通的。
import cv2
a_1 = cv2.imread('a.jpg')
cv2.img_hash_BlockMeanHash.compute(a_1)
我得到:
TypeError: descriptor 'compute' requires a 'cv2.img_hash_ImgHashBase' object but received a 'numpy.ndarray'
这也失败了
a_1_base = cv2.img_hash_ImgHashBase(a_1)
cv2.img_hash_BlockMeanHash.compute(a_1_base)
我得到:
TypeError: Incorrect type of self (must be 'img_hash_ImgHashBase' or its derivative)
Colab 笔记本显示:
https://colab.research.google.com/drive/1x5ZxMBD3wFts2WKS4ip3rp4afDx0lGhi