opencv 3.0 python imshow错误 [英] opencv 3.0 python imshow error

查看:113
本文介绍了opencv 3.0 python imshow错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将OpenCV 3.0与python 2.7.6和ROS Indigo一起使用.我通过安装并尝试进行一些ORB对象检测.具有讽刺意味的是,所有实际的检测代码似乎都没有问题.无法显示的代码已显示.它给出了此错误:

I am using OpenCV 3.0 with python 2.7.6 and ROS Indigo. I installed it through and am attempting to do some ORB object detection. Ironically, all of the actual detection code seems to run without issue. The code that doesn't work is imshow. It gives this error:

OpenCV错误:未指定错误(未实现该功能.在Windows,GTK + 2.x或Carbon支持下重建库.如果在Ubuntu或Debian上,请安装libgtk2.0-dev和pkg-config,然后重新安装运行cmake或配置脚本)在cvShowImage中,文件/tmp/buildd/ros-indigo-opencv3-2.9.6-1trusty-20150512-2345/modules/highgui/src/window.cpp,第534行

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 /tmp/buildd/ros-indigo-opencv3-2.9.6-1trusty-20150512-2345/modules/highgui/src/window.cpp, line 534

在谷歌搜索过程中我没有看到任何这些.有帮助吗?

I haven't seen any of this during my googling. Any help?

推荐答案

如消息所示,您需要使用gtk重建库. 输入您的OpenCV文件夹并创建一个名称为Release的新文件夹.

As the message says, you need to rebuild the library with gtk. Enter into your OpenCV folder and create a new folder with name Release.

cd ~/OpenCV
mkdir Release
cd Release

现在,您需要重建OpenCV.使用以下命令

Now you need to rebuild OpenCV. Use the following command

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_GTK=ON -D WITH_OPENGL=ON ..

记住在构建时使用WITH_GTK=ON.然后,输入以下命令

Remember to use WITH_GTK=ON while building. After this, enter these command

make
sudo make install

现在运行您的代码.这应该使它工作.您可以删除旧的构建文件夹.

Now run your code. This should make it work. You can delete the old build folder.

这篇关于opencv 3.0 python imshow错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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