cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
运行项目时,报错
ValueError: zero-size array to reduction operation maximum which has no identity
``
后来·我调试了一遍程序,发现是路径问题。当我使用 路径一
```python
att_path = 'orig'
att_name = att_path + name + '_' + str(n) + '.png'
会报错
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
但当我把att_name
更改为 路径二
att_name = 'orig/2007_000241_3.png'
就能够顺利运行,这是怎么回事呢?如果我想使用路径一的话,应该怎么操作呢?