|
PortingOpenCVToARMPlatform
#Porting OpenCV to ARM (S3C2440) Platform. This page will tell you how to port OpenCV 2.0.0 into ARM platform. Introduction从下面网站,下载最新的OpenCV 2.0.0。 http://www.opencv.org.cn/index.php/%E9%A6%96%E9%A1%B5 http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/ Details配置OpenCV为ARM体系,以及指定编译器等相关参数: mkdir -p /root/QiuShi/OpenCV-Lib-Inc/ ./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/root/QiuShi/4.4.1/arm-none-linux-gnueabi/include LDFLAGS=-L/root/QiuShi/4.4.1/arm-none-linux-gnueabi/libc/lib/ --with-v4l --prefix=/root/QiuShi/OpenCV-Lib-Inc/
如果在编译时出现png.h: No such file or directory ,意即缺少开发包,比如在Fedora下可以yum install libpng2-dev,或者到libpng的网站 http://www.libpng.org/pub/png/libpng.html ,编译安装开发包即可。 make make install export PKG_CONFIG_PATH=/root/QiuShi/OpenCV-Lib-Inc/lib/pkgconfig:$PKG_CONFIG_PATH 接着,根据需要在/root/QiuShi/OpenCV-Lib-Inc/lib/pkgconfig/opencv.pc的Libs项中加入参数-lpthread、-ldl、-lrt之类,例如 Libs: -L${libdir} -lcv -lcxcore -lcvaux -lml -lpthread -ldl -lrt编译例程
export PKG_CONFIG_PATH=/root/QiuShi/OpenCV-Lib-Inc/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/root/QiuShi/OpenCV-Lib-Inc/lib:$LD_LIBRARY_PATH
cd OpenCV-2.0.0/samples/c arm-linux-g++ drawing.c -o drawing `pkg-config --cflags --libs opencv`
cd OpenCV-2.0.0/samples/c arm-linux-g++ edge.c -o edge `pkg-config --cflags --libs opencv` -lz -lpng -ljpeg Linux主机Fedora下OpenCV的安装
http://www.opencv.org.cn/index.php/%E6%BA%90%E7%A0%81%E7%BC%96%E8%AF%91 |