opencv开源图像处理函数库在S3C2440移植
2011-08-09 17:35
316 查看
一、简介
OpenCV是一个基于C/C++语言的开源图像处理函数库
其代码都经过优化,可用于实时处理图像
具有良好的可移植性
可以进行图像/视频载入、保存和采集的常规操作
具有低级和高级的应用程序接口(API)
二、功能说明
图像数据操作(内存分配与释放,图像复制、设定和转换)
Image data manipulation (allocation, release, copying, setting, conversion).
图像/视频的输入输出(支持文件或摄像头的输入,图像/视频文件的输出)
Image and video I/O (file and camera based input, image/video file output).
矩阵/向量数据操作及线性代数运算(矩阵乘积、矩阵方程求解、特征值、奇异值分解)
Matrix and vector manipulation and linear algebra routines (products, solvers, eigenvalues, SVD).
支持多种动态数据结构(链表、队列、数据集、树、图)
Various dynamic data structures (lists, queues, sets, trees, graphs).
基本图像处理(去噪、边缘检测、角点检测、采样与插值、色彩变换、形态学处理、直方图、图像金字塔结构)
Basic image processing (filtering, edge detection, corner detection, sampling and interpolation, color conversion, morphological operations, histograms, image pyramids).
结构分析(连通域/分支、轮廓处理、距离转换、图像矩、模板匹配、霍夫变换、多项式逼近、曲线拟合、椭圆拟合、狄劳尼三角化)
Structural analysis (connected components, contour processing, distance transform, various moments, template matching, Hough transform, polygonal approximation, line fitting, ellipse fitting, Delaunay
triangulation).
摄像头定标(寻找和跟踪定标模式、参数定标、基本矩阵估计、单应矩阵估计、立体视觉匹配)
Camera calibration (finding and tracking calibration patterns, calibration, fundamental matrix estimation, homography estimation, stereo correspondence).
运动分析(光流、动作分割、目标跟踪)
Motion analysis (optical flow, motion segmentation, tracking).
目标识别(特征方法、HMM模型)
Object recognition (eigen-methods, HMM).
基本的GUI(显示图像/视频、键盘/鼠标操作、滑动条)
Basic GUI (display image/video, keyboard and mouse handling, scroll-bars).
图像标注(直线、曲线、多边形、文本标注)
Image labeling (line, conic, polygon, text drawing)
三、在S3C2440上移植
环境:RedHat AS5
1、涉及的文件libjpeg: http://www.rayfile.com/zh-cn/files/2a4d4dfa-c267-11e0-b204-0015c55db73d/
libpng: http://www.rayfile.com/zh-cn/files/4d7b34b8-c267-11e0-909e-0015c55db73d/
libz: http://www.rayfile.com/zh-cn/files/69cb96bd-c267-11e0-8619-0015c55db73d/
openCV2.0: http://www.rayfile.com/zh-cn/files/a1df3f68-c267-11e0-989c-0015c55db73d/2、编译OpenCV的完整过程:step0:准备环境变量#export OPENCV_BUILD_DIR=/home/openCV/install
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变量的取值跟上面的一致
OpenCV是一个基于C/C++语言的开源图像处理函数库
其代码都经过优化,可用于实时处理图像
具有良好的可移植性
可以进行图像/视频载入、保存和采集的常规操作
具有低级和高级的应用程序接口(API)
二、功能说明
图像数据操作(内存分配与释放,图像复制、设定和转换)
Image data manipulation (allocation, release, copying, setting, conversion).
图像/视频的输入输出(支持文件或摄像头的输入,图像/视频文件的输出)
Image and video I/O (file and camera based input, image/video file output).
矩阵/向量数据操作及线性代数运算(矩阵乘积、矩阵方程求解、特征值、奇异值分解)
Matrix and vector manipulation and linear algebra routines (products, solvers, eigenvalues, SVD).
支持多种动态数据结构(链表、队列、数据集、树、图)
Various dynamic data structures (lists, queues, sets, trees, graphs).
基本图像处理(去噪、边缘检测、角点检测、采样与插值、色彩变换、形态学处理、直方图、图像金字塔结构)
Basic image processing (filtering, edge detection, corner detection, sampling and interpolation, color conversion, morphological operations, histograms, image pyramids).
结构分析(连通域/分支、轮廓处理、距离转换、图像矩、模板匹配、霍夫变换、多项式逼近、曲线拟合、椭圆拟合、狄劳尼三角化)
Structural analysis (connected components, contour processing, distance transform, various moments, template matching, Hough transform, polygonal approximation, line fitting, ellipse fitting, Delaunay
triangulation).
摄像头定标(寻找和跟踪定标模式、参数定标、基本矩阵估计、单应矩阵估计、立体视觉匹配)
Camera calibration (finding and tracking calibration patterns, calibration, fundamental matrix estimation, homography estimation, stereo correspondence).
运动分析(光流、动作分割、目标跟踪)
Motion analysis (optical flow, motion segmentation, tracking).
目标识别(特征方法、HMM模型)
Object recognition (eigen-methods, HMM).
基本的GUI(显示图像/视频、键盘/鼠标操作、滑动条)
Basic GUI (display image/video, keyboard and mouse handling, scroll-bars).
图像标注(直线、曲线、多边形、文本标注)
Image labeling (line, conic, polygon, text drawing)
三、在S3C2440上移植
环境:RedHat AS5
1、涉及的文件libjpeg: http://www.rayfile.com/zh-cn/files/2a4d4dfa-c267-11e0-b204-0015c55db73d/
libpng: http://www.rayfile.com/zh-cn/files/4d7b34b8-c267-11e0-909e-0015c55db73d/
libz: http://www.rayfile.com/zh-cn/files/69cb96bd-c267-11e0-8619-0015c55db73d/
openCV2.0: http://www.rayfile.com/zh-cn/files/a1df3f68-c267-11e0-989c-0015c55db73d/2、编译OpenCV的完整过程:step0:准备环境变量#export OPENCV_BUILD_DIR=/home/openCV/install
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变量的取值跟上面的一致
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)
相关文章推荐
- 基本的opencv图像处理函数
- OpenCV图像处理和图像识别常用函数
- 图像识别与处理之Opencv——图像数据获取与存储(imread()和imwrite()函数)
- 图像识别与处理之Opencv——高斯滤波及GaussianBlur()函数
- OpenCV_图像元素处理常用函数
- opencv图像处理的一些常用函数简单使用
- opencv 数字图像处理-图像缩放 自己写cvResize()函数
- OpenCv入门(三)-图像处理基本函数01
- OpenCV系统学习:二、基本图像处理函数
- opencv常用图像处理函数(C版本)
- (未实用 需多个函数配套使用)opencv3.0 函数学习 10——morphologyEx 形态学图像处理:开运算、闭运算、形态学梯度、顶帽、黑帽合辑
- OpenCv入门(二)-图像处理基本函数
- OpenCV中图像处理函数
- 图像处理_常用函数_OpenCV
- Opencv中做图像处理与识别中常用的函数
- opencv中常用的图像处理函数
- OpenCV 图像处理常用函数(转)
- 【OpenCV】图像处理和图像识别中常用的OpenCV函数汇总
- 【OpenCV 图像轮廓处理函数】
- OpenCV用GDI或者GDI+函数对IplImage图像处理