如何在linux系统centos下通过Eclipse配置opencv
1个回答
2016-07-17 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
1、安装依赖包(很重要)
yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm
如果不安装上述依赖包,到最后调用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 cvNamedWindow,...................
此时只能将编译好的opencv删除再重新编译,即将/usr/local/lib和/usr/local/include/中的有关的删除
mv /usr/local/lib/libopencv*
mv -fr /usr/local/include/opencv
mv -fr /usr/local/include/opencv2
然后再重新编译opencv.
2、安装/更新CMake
为什么要安装或者更新cmake呢,下面说明所chǔ问题:
(1)下载
在OpenCV官网http://sourceforge.net/projects/opencvlibrary/files/ 下载所需版本
拷贝到/usr/local/路径之下
(2)tar -xvf OpenCV-2.4.8.tar.bz2 解压
(3)cd OpenCV-2.4.8 进入目录
(4)yum install cmake 直接从网上安装cmake
(5) cmake CMakeLists.txt
yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm
如果不安装上述依赖包,到最后调用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 cvNamedWindow,...................
此时只能将编译好的opencv删除再重新编译,即将/usr/local/lib和/usr/local/include/中的有关的删除
mv /usr/local/lib/libopencv*
mv -fr /usr/local/include/opencv
mv -fr /usr/local/include/opencv2
然后再重新编译opencv.
2、安装/更新CMake
为什么要安装或者更新cmake呢,下面说明所chǔ问题:
(1)下载
在OpenCV官网http://sourceforge.net/projects/opencvlibrary/files/ 下载所需版本
拷贝到/usr/local/路径之下
(2)tar -xvf OpenCV-2.4.8.tar.bz2 解压
(3)cd OpenCV-2.4.8 进入目录
(4)yum install cmake 直接从网上安装cmake
(5) cmake CMakeLists.txt
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询