错误提示:

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file ..\..\..\modules\highgui\src\window.cpp, line 281
Traceback (most recent call last):
  File "C:/Users/Administrator/PycharmProjects/test3/1.py", line 9, in <module>
    cv2.imshow("250",img)
cv2.error: ..\..\..\modules\highgui\src\window.cpp:281: error: (-215) size.width>0 && size.height>0 in function cv::imshow
 

 

cv2.error: ..\..\..\modules\highgui\src\window.cpp:281: error: (-215) size.width>0 && size.height>0

 

意思是没找到图片,图片要求宽高都大于0.

解决办法:

将你想要显示的图片放到你的工程下,然后就可以运行了

 

cv2.error: ..\..\..\modules\highgui\src\window.cpp:281: error: (-215) size.width>0 && size.height>0

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-11-01
  • 2021-10-10
  • 2021-11-01
  • 2022-01-05
  • 2021-10-29
  • 2021-09-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2021-07-07
  • 2021-09-13
  • 2021-05-23
相关资源
相似解决方案