cv2.imshow error: The function is not implemented. Rebuild the library with Windows...
在python中调用cv2.imshow,出现这个一个报错:
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1268: 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'
解决办法:安装 opencv-contrib-python
pip install opencv-contrib-python
Collecting opencv-contrib-python
Downloading opencv_contrib_python-4.6.0.66-cp36-abi3-win_amd64.whl (42.5 MB)
|████████████████████████████████| 42.5 MB 234 kB/s
Requirement already satisfied: numpy>=1.17.3 in e:\anaconda3\envs\torch\lib\site-packages (from opencv-contrib-python) (1.21.5)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-4.6.0.66
PS: 看源码,imshow正常来讲是在highgui中的,不会依赖contrib。不清楚是否是最新的库中调用了新的函数。
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
