首页 > 其他 > 详细

2、opencv2.4.13.6安装

时间:2018-05-15 20:51:11      阅读:324      评论:0      收藏:0      [点我收藏+]
一、 卸载opencv3.3.0: Going to the "build" folder directory of opencv from terminal, and execute the following:
1. $ sudo make uninstall
2. $ cd ..
3. $ sudo rm -r build
4. $ sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*

这一步可能有error
下面执行如下操作:
5. sudo apt-get –purge remove opencv-doc opencv-data python-opencv

二、 安装opencv,去CSDN下载opencv3.0.0和ippicv_linux_20141027.tgz(http://download.csdn.net/detail/yunlong782/8940743)。

install essential packages
[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
使用cmake-gui安装,首先安装cmake和cmake-qt-gui
1. $ sudo apt-get install cmake cmake-qt-gui
2. 解压opencv3.0.0,并进入目录,建立build目录并进去build目录打开终端,并输入:$ cmake-gui

三、CMake编译opencv

通过cmake-gui命令启动cmake。

技术分享图片

/work/systems/OpenCV-2.0.0/为OpenCV的安装包目录

/work/systems/OpenCVARM/用于生成Makefile的存储。

 

然后点击Configure按钮,选择为Unix Makefiles,选择Specify options for cross-compiling,点击Next

技术分享图片

配置交叉编译器

配置前

技术分享图片

配置后

之前arm-linux-gcc-4.3.2被安装到了/usr/local/arm/4.3.2/bin目录下。

技术分享图片

技术分享图片

然后点击Generate按钮生成Makefile;

四、编译

(1)进入之前Makefile的目录,即之前配置的/work/systems/OpenCVARM目录。

(2)编译:cd  /work/systems/OpenCVARM

      编译命令:su//切换到root权限

      $sudo  make

出错如下:

1、opencv-2.4.13.6/modules/core/src/drawing.cpp:1015: error: call of overloaded ‘abs(long long int&)‘ is ambiguous
把abs改为fabs

2、drawing.cpp:1023: error: integer constant is too large for ‘long‘ type
出错的数据后面加上LL,eg:test = 0x0008888000000000LL

3、

技术分享图片

解决方法:修改CMakeCache.txt,CMAKE_EXE_LINKER_FLAGS原来为空,加上-lpthread  -lrt -ldl,

 

五、make install

(还需要把/usr/local/arm/下的lib和include复制到/usr/local/arm/4.3.2/arm-none-linux-gnueabi下面去,好像是在那篇文章中看到的)

修改/etc/bash.bashrc添加
export PATH=$PATH:/usr/local/arm/4.3.2/bin
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/arm/lib/pkgconfig
export PKG_CONFIG_PATH

修改/etc/ld.so.conf添加
/usr/local/arm/lib

 
 

2、opencv2.4.13.6安装

原文:https://www.cnblogs.com/liusiluandzhangkun/p/9042576.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!