我開始在Python中使用opencv。但我有一些問題。 這裏是我的代碼:未實現Python OpenCV imshow()函數
image = None
image = cv2.imread('7.jpg')
if image != None:
print("len > " + str(len(image)))
# show image
cv2.imshow('image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
else:
print("Image is None")
當我運行這個簡單的代碼,我有這樣的錯誤:
OpenCV Error: Unspecified error (The function is not implemented.
If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage
我檢查了,但安裝了所有的軟件包。我刪除它們並重新安裝。但沒有工作! 我該怎麼辦......
我去查看這個Link
但是當我嘗試這個命令:cmake -D WITH_QT=ON ..
我有這樣的終端:
The source directory "/home" does not appear to contain CMakeLists.txt
我該怎麼辦?
看起來像你在你的home文件夾中運行cmake命令。你應該在'/ your/opencv/source/build'裏運行它,其中'build'是'source'文件夾的子文件夾。 –
我找到了目錄,然後在終端重試這些命令。在終端中一切看起來都很好,但是當我運行代碼時,它說這些功能沒有實現。 –