今天运行python3 的opencv显示图片时遇到了下面的这个问题,在网上找了都好像不对。
OpenCV Error: Unspecified error (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 cvShowImage, file /io/opencv/modules/highgui/src/window.cpp, line 583
Traceback (most recent call last):
File "show.py", line 19, in <module>
cv2.imshow("depth", im_color)
cv2.error: /io/opencv/modules/highgui/src/window.cpp:583: error: (-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
最后发现原来是自己的python3 的opencv安装的版本的问题。
于是解决方法:
pip3 uninstall opencv-python
pip3 install opencv-python
即可。