美文网首页
Windows10,cv2.imshow报错:The funct

Windows10,cv2.imshow报错:The funct

作者: LabVIEW_Python | 来源:发表于2023-03-23 16:09 被阅读0次

    在Windows运行cv2.imshow("demo", img)报错:

    Traceback (most recent call last):
    File "C:\Users\NUC\Desktop\ov_handbook\Chapter2\yolov5s_cls_ov_sync_infer_demo.py", line 45, in <module>
    cv2.imshow("Demo",image)
    cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1272: 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'

    cv2.error

    解决办法:安装opencv-contrib-python

    pip install opencv-contrib-python

    安装opencv-contrib-python

    搞定!

    相关文章

      网友评论

          本文标题:Windows10,cv2.imshow报错:The funct

          本文链接:https://www.haomeiwen.com/subject/cxvirdtx.html