opencv的框架与各模块功能介绍

记录一下自己的所学知识,便于日后回顾与整理。文中内容多为摘录,具体链接如下:

摘录自:https://zhuanlan.zhihu.com/p/33008701(框架介绍)

              http://blog.csdn.net/poem_qianmo/article/details/19925819(各模块介绍,opencv2版,毛星云)

              http://blog.csdn.net/zmdsjtu/article/details/54924727(opencv3与opencv2的对比,很棒!)

官方文档:

opencv官网:https://opencv.org/

opencv库各版本下载:https://sourceforge.net/projects/opencvlibrary/files/

opencv中文网站论坛:http://www.opencv.org.cn/

opencv 1.x中文文档:http://wiki.opencv.org.cn/index.php/%E9%A6%96%E9%A1%B5

opencv 2.3文档:http://www.opencv.org.cn/opencvdoc/2.3.2/html/index.html

opencv 3.4文档:https://docs.opencv.org/master/

 1.1 opencv介绍

        OpenCV (Open Source Computer Vision Library: http://opencv.org) is an open-source BSD-licensed library that includes several hundreds of computer vision algorithms. The document describes the so-called OpenCV 2.x API, which is essentially a C++ API, as opposite to the C-based OpenCV 1.x API. The latter is described in opencv1x.pdf.

OpenCV has a modular structure, which means that the package includes several shared or static libraries. The following modules are available:

    Core functionality - a compact module defining basic data structures, including the dense multi-dimensional array Mat and basic functions used by all other modules.
    Image processing - an image processing module that includes linear and non-linear image filtering, geometrical image transformations (resize, affine and perspective warping, generic table-based remapping), color space conversion, histograms, and so on.
    video - a video analysis module that includes motion estimation, background subtraction, and object tracking algorithms.
    calib3d - basic multiple-view geometry algorithms, single and stereo camera calibration, object pose estimation, stereo correspondence algorithms, and elements of 3D reconstruction.
    features2d - salient feature detectors, descriptors, and descriptor matchers.
    objdetect - detection of objects and instances of the predefined classes (for example, faces, eyes, mugs, people, cars, and so on).
    highgui - an easy-to-use interface to simple UI capabilities.
    Video I/O - an easy-to-use interface to video capturing and video codecs.
    gpu - GPU-accelerated algorithms from different OpenCV modules.
    ... some other helper modules, such as FLANN and Google test wrappers, Python bindings, and others.

The further chapters of the document describe functionality of each module. But first, make sure to get familiar with the common API concepts used thoroughly in the library.
                                                                                                                                    -----以上摘录自官方文档

      OpenCV(Open Source Computer Vision Library)开放源代码计算机视觉库,主要算法涉及图像处理、计算机视觉和机器学习相关方法。OpenCV 其实就是一堆 C 和 C++语言的源代码文件,这些源代码文件中实现了许多常用的计算机视觉算法。

       OpenCV由一系列C函数和C++类构成,它有C,C++,Python和java接口,当前SDK(Software Development Kit软件开发工具包) 已经支持C++、Java、Python等语言应用开发, 当前OpenCV本身新开发的算法和模块接口都是基于C++产生。

       其覆盖了工业产品检测、医学成像、无人机飞行、无人驾驶、安防、 卫星地图与电子地图拼接、信息安全、用户界面、摄像机标定、立体视觉和机器人等计算机视觉应用领域。

       图像处理(Image Processing)是用计算机对图像进行分析,以达到所需结果的技术。图像处理技术一般包括图像压缩,增强和复原,匹配、描述和识别3个部分。数字图像处理(Digital Image Processing)是通过计算机对图像进行去除噪声、增强、复原、分割、提取特征等处理的方法和技术。

       计算机视觉(Computer Vision)是指用摄像机和电脑代替人眼对目标进行识别、跟踪和测量等机器视觉,并进一步做图形处理,使之成为更适合人眼观察或仪器检测图像的一门学科。


1.2 opencv架构

                             

                       

opencv2文件夹所含模块如下图所示:

          

     

                

各主要模块介绍:

【core】--核心功能模块,包含以下内容:

    OpenCV基本数据结构
    动态数据结构
    绘图函数
    数组操作相关函数
    辅助功能与系统函数和宏
    与OpenGL的互操作


【imgproc】--图像处理模块,包含以下内容:

    线性和非线性的图像滤波
    图像的几何变换
    其它(Miscellaneous)图像转换
    直方图相关
    结构分析和形状描述
    运动分析和对象跟踪
    特征检测
    目标检测等内容


【features2D】--2D功能模块,包含以下内容:

    特征检测和描述
    特征检测器(Feature Detectors)通用接口
    描述符提取器(Descriptor Extractors)通用接口
    描述符匹配器(Descriptor Matchers)通用接口
    通用描述符(Generic Descriptor)匹配器通用接口
    关键点绘制函数和匹配功能绘制函数


【highgui】--高层gui图形用户界面(high GUI),包含:

    媒体的I / O输入输出

    视频捕捉

    图像和视频的编码解码

    图形交互界面的接口等内容

    关键点绘制函数和匹配功能绘制函数

    关键点绘制函数和匹配功能绘制函数


【ml】——Machine Learning,机器学习模块, 基本上是统计模型和分类算法,包含如下内容:

    统计模型 (Statistical Models)
    一般贝叶斯分类器 (Normal Bayes Classifier)
    K-近邻 (K-NearestNeighbors)
    支持向量机 (Support Vector Machines)
    决策树 (Decision Trees)
    提升(Boosting)
    梯度提高树(Gradient Boosted Trees)
    随机树 (Random Trees)
    超随机树 (Extremely randomized trees)
    期望最大化 (Expectation Maximization)
    神经网络 (Neural Networks)
    MLData


【calib3d】——其实就是就是Calibration(校准)加3D这两个词的组合缩写。这个模块主要是相机校准和三维重建相关的内容。基本的多视角几何算法,单个立体摄像头标定,物体姿态估计,立体相似性算法,3D信息的重建等等。

【contrib】——也就是Contributed/Experimental Stuf(贡献、实验部分)的缩写, 该模块包含了一些最近添加的不太稳定的可选功能,不用去多管。2.4.8里的这个模块有新型人脸识别,立体匹配,人工视网膜模型等技术。我所安装的opencv3.4版本已将此模块去掉啦

【flann】—— Fast Library for Approximate Nearest Neighbors,高维的近似近邻快速搜索算法库,包含两个部分:

    快速近似最近邻搜索

    聚类  

【legacy】——  一些已经废弃的代码库,保留下来作为向下兼容,包含如下相关的内容:

                                     运动分析

                                     期望最大化

                直方图
                平面细分(C API)
                特征检测和描述(Feature Detection and Description)
                描述符提取器(Descriptor Extractors)的通用接口
                通用描述符(Generic Descriptor Matchers)的常用接口
                匹配器

【nonfree】,也就是一些具有专利的算法模块 ,包含特征检测和GPU相关的内容。最好不要商用,可能会被告哦。

 【objdetect】——目标检测模块,包含Cascade Classification(级联分类)和Latent SVM这两个部分。

 【ocl】——即OpenCL-accelerated Computer Vision,运用OpenCL加速的计算机视觉组件模块

 【photo】——也就是Computational Photography,包含图像修复和图像去噪两部分

 【stitching】——images stitching,图像拼接模块,包含如下部分:

    拼接流水线
    特点寻找和匹配图像
    估计旋转
    自动校准
    图片歪斜
    接缝估测
    曝光补偿
    图片混合

【superres】——SuperResolution,超分辨率技术的相关功能模块

 【ts】——opencv测试相关代码,不用去管他

 【video】——视频分析组件,该模块包括运动估计,背景分离,对象跟踪等视频处理相关内容。

 【Videostab】——Video stabilization,视频稳定相关的组件,官方文档中没有多作介绍,不管它了。

注意:opcv3新增了shape模块!

【shape】--形状的匹配以及距离计算SHAPE

Shape Distance and Matching,形状的距离以及匹配
//对这部分了解不是很多,只能形而上学地复制过来了
Opencv3特有的部分,Opencv2.4并没有…
1. AffineTransformer仿射变换算法的包装类
2. HistogramCostExtractor
3. HausdorffDistanceExtractor
4. ShapeContextDistanceExtractor
5. ThinPlateSplineShapeTransformer

1.3 opencv2和opencv3的区别

    旧版opencv已包含的模块:

       

opencv3和opencv2的区别:

          

列举几条:

(1)opencv3新增了Shape模块

(2)cv3新增了Logistic Regression(逻辑回归):类似于SVM也是一种多分类器

(3)cv3删掉了contrib模块


1.4 使用方法

    实际上,opencv将每个模块中的源文件编译成一个库文件 ,用户在使用时, 仅将所需的库文件添加到自己的项目中,与自己的源文件一起连接成可执行程序即可。



原文:https://blog.csdn.net/u012679707/article/details/79505279
 

猜你喜欢

转载自blog.csdn.net/boyemachao/article/details/88993659