2017-03-16 141 views
0

最近我一直在試圖在我的電腦上安裝OpenCV。首先,我嘗試在Windows上安裝。我嘗試了一些教程,並保留了一段時間,直到我放棄了。論壇上的一些人表示他們在Ubuntu Linux中完成了我在Windows上完成的相同過程。現在,我已經安裝了Ubuntu並遵循this教程。在本教程的一切工作順利,直到我跑了find_game.py腳本,並得到這個錯誤信息:在Ubuntu上使用Python安裝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 "find_game.py", line 24, in cv2.imshow("Image", image) 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.

我已經找遍了論壇,並在每一個我得到的答案重裝的OpenCV」一些變化與cmake「。我試圖用cmake重新加載OpenCV多次,但每次彈出相同的錯誤消息。我可能沒有正確安裝opencv_contrib庫,但我知道我確實按照教程中的每一步操作。如果有人知道我應該做什麼,這將是一個很大的幫助。

回答

0

我解決了我的問題。我發現我只安裝了opencv來使用python 2.7,每次我只輸入python find_game.py。我發現當我這樣做時,它使用最新版本(即python 3.5)而不是python 2.7,因此它不兼容。我很容易解決這個問題,而不是做python2.7 find_game.py