ARM 中安装OpenCV
来源:互联网 发布:雪碧图动画 java 编辑:程序博客网 时间:2024/06/14 00:39
1.下载 1.0或者2.0 版本opencv
2.
./configure --host=arm-linux --without-gtk --without-carbon --without-quicktime --without-1394libs --without-ffmpeg --without-python --without-swig --enable-static --disable-shared --disable-apps CXX=arm-linux-g++ CPPFLAGS=-I/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/include
./configure --host=arm-linux --without-gtk --without-carbon --without-quicktime --without-1394libs --without-ffmpeg --without-python --without-swig --enable-static --disable-shared --disable-apps CXX=arm-linux-g++ CPPFLAGS=-I/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/include LDFLAGS=-L/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/lib --with-v4l --prefix=/opt/opencv-arm --libdir=/opt/opencv-arm/lib --includedir=/opt/opencv-arm/include
- --host=arm-linux :指出交叉编译arm平台
- --without-gtk:忽略gtk+2.0 windows
- --without-carbon: 不使用Mac OS上的X库
- --without-quicktime
- --without-1394libs
- --without-ffmpeg
- --without-python
- --without-swig
- --enable-static :生成静态库
- --disable-shared:不生成动态库
- CXX=arm-linux-g++ : 指定编译工具(建议用2.95.2或者2.95.3版本)
- CPPFLAGS=-I/usr/include :OpenCV会用到一些dev的包,如png.h,jpeglib.h,大部分头文件在/usr/include下。
如果在编译时出现png.h: No such file or directory ,意即缺少开发包,比如在Debian下可以apt-get install libpng2-dev,或者到libpng的网站 http://www.libpng.org/pub/png/libpng.html ,编译安装开发包即可。
make make installexport PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
接着,根据需要在/usr/local/lib/pkgconfig/opencv.pc的Libs项中加入参数-lpthread、-ldl之类,例如
Libs: -L${libdir} -lcv -lcxcore -lcvaux -lml -lpthread -ldl //这里是加入以前没有的库就可以了 否则会显示多次加载 最后结果:Libs: -L${libdir} -lcv -lhighgui -lcvaux -lml -lcxcore -lpthread -ldl -lrt -fopenmp
编译例程
- 编译例程drawing.c
arm-linux-g++ drawing.c `pkg-config --cflags --libs opencv` -o drawing
arm-linux-g++ drawing.c -o drawing -I/root/opencv-arm/include/opencv -L/root/opencv-arm/lib -lcv -lhighgui -lcvaux -lml -lcxcore -lpthread -ldl -lrt -fopenmp
- 编译修改后的摄像头标定程序:
arm-linux-g++ `pkg-config --cflags --libs opencv` calibration.cpp -o calibration
将生成的可执行程序拷贝到开发板上,运行。如果出现缺少libstdc++库的情况,可以在arm编译器目录下的lib目录中查找,拷贝到开发板中,并确保程序可以找到即可。
摄像头驱动
内核选项加入ovXXXX 驱动,并且模块加载。OpenCV程序中默认设备为/dev/video0 ,在程序中调用cvCaptureFromCAM函数可以直接获取摄像头,并采集图像。
显示
直接在要显示的地方调用显示驱动函数。
- ARM 中安装OpenCV
- opencv嵌入式ARM系统中安装
- arm编译安装openCV整理
- 交叉编译环境(arm-linux-gcc)中opencv的安装
- ARM-Linux环境下安装OpenCV
- ARM-Linux环境下安装OpenCV
- arm开发板ubuntu14.04安装opencv
- 嵌入式ARM系统中OpenCV的移植
- 嵌入式ARM系统中OpenCV的移植
- 移植Opencv到Arm开发板中
- OpenCV - Linux中安装使用OpenCV
- Linux下安装opencv并移植至ARM
- ubuntu12中opencv安装,官方
- eclipse中OpenCV安装指南
- ubuntu14.04中安装opencv
- 在ubuntu中安装opencv
- 在Anaconda中安装opencv
- 在Ubuntu中安装 arm-linux-gcc
- Java编程中“为了性能”尽量要做到的一些地方
- 交换两个数组的值,使其和的差值最小
- 渡过生死线
- CentOS下LDAP服务配置指南
- DIV+CSS设计时浏览器兼容性问题
- ARM 中安装OpenCV
- 6410上移植uboot
- abap debug中设置watchpoint
- Eclipse注释乱码
- web.xml 通过 contextConfigLocation 配 spring 方式
- HDOJ 4054 Hexadecimal View
- android 带表头,左右两个联动的ListView
- J2EE之Servlet
- 文章11:同步与异步 阻塞与非阻塞