YOLOv7调用摄像头检测报错解决

发布时间:2024年01月22日

yolov7detect.py文件调用本地摄像头,把source参数设为0

    parser.add_argument('--source', type=str, default='0', help='source')  # file/folder, 0 for webcam

报错:cv2.error: OpenCV(3.4.2) 一堆地址:The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon 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'

我原本的环境里opencv-python版本是4.1.2.30

参考链接:The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support-CSDN博客

我的解决方法,卸载opencv-python

pip uninstall opencv-python

再重新安装

pip install opencv-python
pip install opencv-contrib-python

就好使了

文章来源:https://blog.csdn.net/cyh20182808/article/details/135746926
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。