import cv2
img = cv2.imread(’/01.jpg’)
cv2.imshow(‘img’, img)
cv2.waitKey(0)
运行时报错
Traceback (most recent call last):
File “/Users/wy/opencv/testopencv.py”, line 3, in
cv2.imshow(‘img’, img)
cv2.error: OpenCV(4.5.4) /Users/runner/work/opencv-python/opencv-python/opencv/modules/highgui/src/window.cpp:1006: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’