Linux下debian系统安装配置OpenCV并检测程序

1、安装pkg-config

sudo apt-get install pkg-config 

安装后可以执行

pkg-config --version

检测pkg-config的版本号

2、查询OpenCV相关软件包

apt-cache search opencv

libcv-dev - development files for libcv
libcv2.3 - computer vision library
libcvaux-dev - development files for libcvaux
libcvaux2.3 - computer vision extension library
libhighgui-dev - development files for libhighgui
libhighgui2.3 - computer vision GUI library
opencv-doc - OpenCV documentation and examples
python-opencv - Python bindings for the computer vision library
安装相关软件包(我的是libcv2.3的,每个机子可能安装的不一样,按照查询出来的安装)

 apt-get install libcv2.3 libcvaux2.3 libhighgui2.3
 apt-get install libcv-dev libcvaux-dev libhighgui-dev

3、测试时出现

Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found

这个时候参考http://stackoverflow.com/questions/15320267/package-opencv-was-not-found-in-the-pkg-config-search-path

在/usr/lib/pkgconfig文件夹中创建一个opencv.pc文件

内容如下

prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: opencv
Description: The opencv library
Version: 2.x.x
Cflags: -I${includedir}/opencv -I${includedir}/opencv2
Libs: -L${libdir} -lopencv_calib3d -lopencv_imgproc -lopencv_contrib -lopencv_legacy -lopencv_core -lopencv_ml -lopencv_features2d -lopencv_objdetect -lopencv_flann -lopencv_video -lopencv_highgui






阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/bolvtin/article/details/49047443
文章标签: debina opencv
个人分类: Linux开发
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭