今天運行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
即可。