1.先查询 opencv :
~# apt-cache search opencv libcv-dev - Translation package for libcv-dev libcv2.3 - computer vision library - libcv* translation package libcvaux-dev - Translation package for libcvaux-dev libcvaux2.3 - computer vision library - libcvaux translation package libhighgui-dev - Translation package for libhighgui-dev libhighgui2.3 - computer vision library - libhighgui translation package libopencv-calib3d-dev - development files for libopencv-calib3d libopencv-calib3d2.3 - computer vision Camera Calibration library libopencv-contrib-dev - development files for libopencv-contrib libopencv-contrib2.3 - computer vision contrib library libopencv-core-dev - development files for libopencv-core libopencv-core2.3 - computer vision core library libopencv-dev - development files for opencv libopencv-features2d-dev - development files for libopencv-features2d libopencv-features2d2.3 - computer vision Feature Detection and Descriptor Extraction library libopencv-flann-dev - development files for libopencv-flann libopencv-flann2.3 - computer vision Clustering and Search in Multi-Dimensional spaces library libopencv-gpu-dev - development files for libopencv-gpu libopencv-gpu2.3 - computer vision GPU Processing library libopencv-highgui-dev - development files for libopencv-highgui libopencv-highgui2.3 - computer vision High-level GUI and Media I/O library libopencv-imgproc-dev - development files for libopencv-imgproc libopencv-imgproc2.3 - computer vision Image Processing library libopencv-legacy-dev - development files for libopencv-legacy libopencv-legacy2.3 - computer vision legacy library libopencv-ml-dev - development files for libopencv-ml libopencv-ml2.3 - computer vision Machine Learning library libopencv-objdetect-dev - development files for libopencv-objdetect libopencv-objdetect2.3 - computer vision Object Detection library libopencv-video-dev - development files for libopencv-video libopencv-video2.3 - computer vision Video analysis library opencv-doc - OpenCV documentation and examples python-opencv - Python bindings for the computer vision library
2.根据查询结果安装
# apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 # apt-get install libcv-dev libcvaux-dev libhighgui-dev
codeblocks + opencv 配置
1. 相关文件位置
~# pkg-config --cflags opencv # opencv 头文件(.h) 位置
-I/usr/include/opencv
~# pkg-config --libs opencv # opencv 库文件
-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
2. codeBlocks链接库配置: Project -> Build Options 如下图:
3. codeBlocks 头文件目录配置(pkg-config --cflags opencv 结果)
4. CodeBlocks 路文件目录配置
5. 测试结果