cv2.error: OpenCV(4.8.1) D:xxxerror: (-2:Unspecified error) The function is not implemented.报错

在用harries角点检测算法的过程中,遇到了这个报错:
 


cv2.error: OpenCV(4.8.1) 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'

然后先问了一下gpt,gpt说 : 

我估计可能是版本问题,最后找到了这个链接  :

Link

那么要怎么解决呢?

执行下面命令即可 : 

This solution seems to work for a majority of users, but not all. If you are in this case, see the proposed answer by Sachin Mohan.

I had the exact same error using yolov5, on Windows 10. Reinstalling the library by typing

pip uninstall opencv-python 

then

pip install opencv-python

 后面就可以显示图像了;

猜你喜欢

转载自blog.csdn.net/ros275229/article/details/135209875
今日推荐