opencv开源图像处理函数库在S3C2440移植(2)
- UID
- 1029342
- 性别
- 男
|
opencv开源图像处理函数库在S3C2440移植(2)
step1: 编译zlib
#tar xzf zlib-1.2.4.tar.gz
#cd zlib-1.2.4
./configure --prefix=$OPENCV_BUILD_DIR/install
#vi Makefile
替换gcc为arm-linux-gcc
替换ar为arm-linux-ar
替换ranlib为arm-linux-ranlib
#make
#make install
step2:编译jpeg库
#tar xzf jpegsrc.v8a.tar.gz
#cd jpeg-8a
./configure --host=arm-linux --prefix=$OPENCV_BUILD_DIR/install
#make
#make install
step3:编译libpng库
#tar xzf libpng-1.2.43.tar.gz
#cd libpng-1.2.43
./configure --host=arm-linux --prefix=$OPENCV_BUILD_DIR/install
#make
#make install
step4:编译OpenCV
#tar xjf OpenCV-2.0.0.tar.bz2
#cd OpenCV-2.0.0
#./configure --host=arm-linux --without-gtk --without-carbon --without-quicktime --without-1394libs --without-ffmpeg --without-python --without-swig --disable-static --enable-shared --disable-apps CXX=arm-linux-g++ --prefix=$OPENCV_BUILD_DIR/install --libdir=$OPENCV_BUILD_DIR/install/lib -includedir=$OPENCV_BUILD_DIR/install/include
#make
#make install
最后,strip生成的库:
#find | xargs file | grep "not stripped" | cut -d: -f1 | xargs arm-linux-strip
3、编译程序编译基于openCV库的应用程序一般使用以下Makefile配合编译:注意LIBOPENCV变量的取值跟上面的一致
[plain] view plaincopy
- TARGET = cvRect
- SRC = cvRect.cpp
- LIBOPENCV := /home/openCV/install
- CFLAGS = -I$(LIBOPENCV)/include/opencv
- LDFLAGS = -L$(LIBOPENCV)/lib -lm -lcv -lcvaux -lcxcore -lhighgui -lml -lpthread -ljpeg -lpng -lrt -lcxcore -lz
- $(TARGET): $(SRC)
- arm-linux-g++ $(CFLAGS) $(SRC) -o $(TARGET) $(LDFLAGS)
- arm-linux-strip $(TARGET)
- clean:
- rm -rf $(TARGET)
|
|
|
|
|
|