OpenCV错误:未实现WaitKey()函数

问题描述:

我已经在我的机器上安装了Ubuntu 14.04(64位)。OpenCV错误:未实现WaitKey()函数

我已经安装了python 3.6和OpenCV 3。当我试图运行下面的代码行时,会引发错误。

key = cv2.waitKey(0) 

的错误如下:

error: /feedstock_root/build_artefacts/opencv_1489510052062/work/opencv-3.1.0/modules/highgui/src/window.cpp:616: 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 cvWaitKey

我已经安装了libgtk2.0-dev软件包,但它并没有得到解决。 我是否需要安装其他软件包?

+0

你有没有在你的代码中使用的TrackBar?你能否显示你的代码,以便知道你的代码放在哪里? – thewaywewere

+0

“我已经安装了libgtk2.0-dev软件包,但它没有解决。”是的,你需要执行所有的指示,而不仅仅是一步。它很清楚地说“重建图书馆”... [相关问题](https://*.com/search?q=The+function+is+not+implemented.+Rebuild+the+library) –

您错过了几个OpenCV依赖的库,在Linux上安装OpenCV非常简单,只需使用安装shell脚本并执行即可。它将安装所有的依赖关系,并正确安装OpenCV,这里是我在过去使用的.sh

https://github.com/milq/milq/blob/master/scripts/bash/install-opencv.sh