Skip to content

python: 'cv2.img_hash_BlockMeanHash' object has no attribute 'compute' #3171

@doublex

Description

@doublex

Works: opencv-contrib-python-headless-4.5.4.60
Fails: opencv-contrib-python-headless-4.5.5.62

Testcase:

import numpy, cv2   # pip3 install opencv-contrib-python-headless
frame = numpy.zeros((16,16,3), numpy.uint8)
hash_blockmean = cv2.img_hash_BlockMeanHash.create()
blockhash = hash_blockmean.compute(frame)
assert all(blockhash[0][i] == 0xff for i in range(32))

Console:

Traceback (most recent call last):
  File "/tmp/ab.py", line 4, in <module>
    blockhash = hash_blockmean.compute(frame)
AttributeError: 'cv2.img_hash_BlockMeanHash' object has no attribute 'compute'

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions