:錯誤嘗試,當我使用<code>cv2.imshow</code>這樣使用cv2.imshow
import numpy as np
import cv2
img = cv2.imread('galaxy.jpg',0)
cv2.imshow('image',img)
我得到以下錯誤:
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 -------src-dir-------/opencv-2.4.10/modules/highgui/src/window.cpp, line 501
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cv2.error: -------src-dir-------/opencv-2.4.10/modules/highgui/src/window.cpp:501: 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
附:只編輯了編程部分代碼。感謝計算器反饋
錯誤很明顯。你需要有GTK或碳支持(或者在Windows上)。 – y300
你使用哪個操作系統? – Micka
要執行代碼格式化,請在每行代碼前放置4個空格。簡單的方法是選擇代碼行並點擊ctrk-k。這將縮進整個選定的塊給你。 http://stackoverflow.com/help/formatting – beaker