windows下python调用opencv,提示以下问题:
cv2.error: OpenCV(4.9.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'
我们看解释错误,好像说的是windows不支持这个版本,让你使用linux什么的,其实不用转战Linux,只是缺少了一个模块opencv-contrib,
只需安装opencv-contrib-python,如下,在终端输入命令进行安装:
pip install opencv-contrib-python
有问题可以评论讨论。
标签:python,Rebuild,GTK,library,opencv,error,contrib From: https://blog.csdn.net/weixin_58183392/article/details/137567989