我正在尝试在 python 中使用 OpenCV 读取以下大型 qr 代码
首先我加载图像:
import cv2
img = cv2.imread("qrgame.png")
然后,我确定 qr 的边界框:
detect = cv2.QRCodeDetector()
shouldBeTrue, points = detect.detect(img)
assert shouldBeTrue
断言通过了,但是当我去解码 qr 时,运行:
detect.decode(img, points)
它失败并出现以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\core\src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 41209000000 bytes in function 'cv::OutOfMemoryError'