【常见问题】python调用cv2.imshow()显示图像失败(非路径问题)
报错error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.
·
前言
在尝试对摄像头传回视频进行实时目标检测时,需要将模型返回的生成图进行显示(故排除因路径问题而报错),cv2.imshow()出现错误。
出现错误
报错如下:
error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows. GTK+ 2.x or Cocoa support.If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function ‘cvShowImage’
解决方法
在anaconda prompt 对应环境下安装opencv-contrib-python
pip install opencv-contrib-python
再运行就不会报错了!(●’◡’●)
-------tbc------
有用请👍哦~
更多推荐
已为社区贡献1条内容
所有评论(0)