参考链接:http://bbs.csdn.net/topics/390145759
1 扩展库简介
OpenCV(Open Source Computer Vision Library)是一个致力于实时处理计算机视觉问题的开源库。它最初由Intel公司开发,以GPL许可协议发布,后来由Willow Garage基金会负责开发和维护,以BSD许可协议发布,至今已有超过250万的用户。其用途非常广泛,涵盖从图像处理,计算机视觉到交互艺术,矿产勘探等领域。OpenCV最初以C语言编写,后来提供了C++和Python接口,在版本2.2中又加入了CUDA接口,目前的正式版本为2.4。
OpenCL(Open Computing Language)是一个在异构平台(例如:CPU和GPU,APU)上高效执行程序的开源计算框架,它由Khronos发布并维护,是一个IBM, Intel, AMD等业界公司普遍认可和支持的标准,目前版本为1.2。OpenCL包含一组用于定义和控制平台的API和一个基于C99标准的编写的可执行在并行设备上的kernel。它使应用程序能够在GPU上执行,使GPU可以不仅执行图形程序,而且可以执行通用计算程序(GPGPU)。
虽然OpenCV的目标是能够实时的处理计算机视觉问题,但是大多数计算机视觉的算法太过复杂,无法在CPU上实时执行。而计算机视觉的大多数算法具有天生的并行性,非常适合在GPU和APU上执行并获得可观的加速比。本工程使用和OpenCV兼容的C/C++编写,致力于为OpenCV添加OpenCL接口,使得OpenCV的函数能够在异构设备上高速运行。由于OpenCL是一个跨平台的开放标准,所有支持OpenCL的平台都将获益。
2 OpenCV的架构
OpenCV可以分成以下一些模块,以执行设备来分类的话有CPU和GPU之分,GPU中原有CUDA模块,现在我们加入OpenCL模块,OpenCL模块将在CPU上执行的算法在GPU上加速执行。
补充:
Since version 2.2, the OpenCV library is divided into several modules. These modules are built in library fles located in the lib directory. They are:
1 The opencv_core module that contains the core functionalities of the library, in particular, the basic data structures and arithmetic functions.
2 The opencv_imgproc module that contains the main image processing functions.
3 The opencv_highgui module that contains the image and video reading and writing functions, along with other user interface functions.
4 The opencv_features2d module that contains the feature point detectors and descriptors and the feature point matching framework.
5 The opencv_calib3d module that contains the camera calibration, two-view geometry estimation, and stereo functions.
6 The opencv_video module that contains the motion estimation, feature tracking, and foreground extraction functions and classes.
7 The opencv_objdetect module containing the object detection functions such as the face and people detectors.
The library also includes other utility modules containing machine learning functions (opencv_ml), computational geometry algorithms (opencv_flann), contributed code (opencv_contrib), obsolete code (opencv_legacy), and GPU accelerated code (opencv_gpu).
All of these modules have a header fle associated with them (located in include directory).
Typical OpenCV C++ code will therefore start by including the required modules. For example
(and this is the suggested declaration style):
#include
#include
#include
If you see OpenCV code starting with:
#include "cv.h"
it is because it uses the old style, before the library was restructured into modules.
翻译:
opencv自从2.2版本起,将库分成很多模块,这些模块编译成库,放在opencv的lib文件夹下。他们分别是:
1. opencv_core 模块 它包含库的核心函数,实际上它包含基本的数据结构和算术函数
2. opencv_imgproc 模块 它包含主要的图像处理函数
3. The opencv_highgui 模块,它包含图像和视频的读写函数以及用户交互函数
4. opencv_features2d 模块,它包含特征点的检测、描述以及匹配的框架
5. opencv_calib3d 模块,它包含摄像头的校准,双目几何估计和立体函数
6. opencv_video 模块,它包含运动目标估计,特征跟踪和前景提取的函数和类
7. opencv_objdetect 模块,它包含目标检测函数如人脸检测,和行人检测
opencv库还包含其他单元模块如机器学习模块 (opencv_ml), 计算几何算法模块(opencv_flann), 已贡献代码模块(opencv_contrib), 过时的代码模块opencv_legacy以及图形加速模块(opencv_gpu).
所有的模块都有一个与之关联的头文件(在include路径下)
典型的OPENCV c++代码通常以包含这些必须的模块开始,如:
#include
#include
#include