搜索
查看: 1453|: 0

ubuntu12.04配置qt4+opencv2.4.1环境

[复制链接]

134

主题

2

回帖

528

积分

高级会员

积分
528
发表于 2014-9-17 16:08:52 | 显示全部楼层 |阅读模式

首先安装g++

hugo@hugo-ThinkPad-Edge:~$ sudo apt-get install g++hugo@hugo-ThinkPad-Edge:~$ sudo apt-get install g++ automake安装qt4相关hugo@hugo-ThinkPad-Edge:~$ sudo apt-get install libqt4-dev qt4-dev-tools qt4-designer qt4-doc qt4-demos安装qt4 creator

下载地址: http://qt-project.org/downloads/

下载后是run文件,修改权限并运行,然后图形化界面安装

hugo@hugo-ThinkPad-Edge:~/Downloads$ sudo chmod 777 qt-creator-opensource-linux-x86_64-3.0.1.run 配置opencv环境

首先更新和升级系统

hugo@hugo-ThinkPad-Edge:~$ sudo apt-get updatehugo@hugo-ThinkPad-Edge:~$ sudo apt-get upgrade安装必要的依赖环境sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev下载、编译、运行opencv2.4.1(不建议2.4.8,我配置2.4.8后出现问题)hugo@hugo-ThinkPad-Edge:~/Downloads$ wget http://downloads.sourceforge.net ... penCV-2.4.1.tar.bz2hugo@hugo-ThinkPad-Edge:~/Downloads$ tar jxvf OpenCV-2.4.1.tar.bz2 hugo@hugo-ThinkPad-Edge:~/Downloads$ cd OpenCV-2.4.1hugo@hugo-ThinkPad-Edge:~/Downloads/Opencv-2.4.1$ mkdir buildhugo@hugo-ThinkPad-Edge:~/Downloads/Opencv-2.4.1$ cd buildhugo@hugo-ThinkPad-Edge:~/Downloads/OpenCV-2.4.1/build$  cmake -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_OPENGL=ON ..hugo@hugo-ThinkPad-Edge:~/Downloads/OpenCV-2.4.1/build$ makehugo@hugo-ThinkPad-Edge:~/Downloads/OpenCV-2.4.1/build$ sudo make install编辑环境变量hugo@hugo-ThinkPad-Edge:~/Downloads/OpenCV-2.4.1/build$ sudo vim /etc/ld.so.conf.d/opencv.conf

添加opencv库所在路径:

/usr/local/libhugo@hugo-ThinkPad-Edge:~/Downloads/OpenCV-2.4.1/build$ sudo ldconfighugo@hugo-ThinkPad-Edge:~/Downloads/OpenCV-2.4.1/build$ sudo vim /etc/bash.bashrc 在末尾添加:PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfigexport PKG_CONFIG_PATH至此,配置成功。

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

大数据中国微信

QQ   

版权所有: Discuz! © 2001-2013 大数据.

GMT+8, 2024-12-23 22:46 , Processed in 0.067757 second(s), 24 queries .

快速回复 返回顶部 返回列表