OpenCV错误:未实现WaitKey()函数 [英] OpenCV error: WaitKey() function not implemented

查看:580
本文介绍了OpenCV错误:未实现WaitKey()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在计算机上安装了ubuntu 14.04(64位).

I've ubuntu 14.04(64-bit) installed on my machine.

我已经安装了python 3.6和OpenCV 3.当我尝试运行以下代码行时,它将引发错误.

I've python 3.6 and OpenCV 3 installed on it. When I'm trying to run the following line of code it throws error.

key = cv2.waitKey(0)

错误如下:

错误: /feedstock_root/build_artefacts/opencv_1489510052062/work/opencv-3.1.0/modules/highgui/src/window.cpp:616: 错误:(-2)该功能未实现.用以下方法重建库 Windows,GTK + 2.x或Carbon支持.如果您使用的是Ubuntu或Debian, 安装libgtk2.0-dev和pkg-config,然后重新运行cmake或配置 函数cvWaitKey中的脚本

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软件包,但是没有解决. 我还需要安装其他软件包吗?

I've installed the libgtk2.0-dev package but it doesn't got resolved. Do I need to install any other packages?

推荐答案

您缺少一些OpenCV依赖的库,在Linux上安装OpenCV非常容易,只需使用安装Shell脚本并执行它即可.它将安装所有依赖项并正确安装OpenCV,这是我过去使用的.sh:

You are missing a few libraries that OpenCV depends on, it is very easy to install OpenCV on Linux, just use an install shell script and execute it. It will install all the dependencies and install OpenCV correctly, here is a .sh that I have used in the past:

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

这篇关于OpenCV错误:未实现WaitKey()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆