search
HomeDatabaseMysql Tutorial一览众山小:OpenCV 2.4.8组件结构全解析

【原文:http://blog.csdn.net/poem_qianmo/article/details/19925819】 文章链接: http://blog.csdn.net/poem_qianmo/article/details/19925819 作者:毛星云(浅墨)邮箱: happylifemxy@163.com 写作当前博文时配套使用OpenCV版本:2.4.8 之前啃了不少Op

【原文:http://blog.csdn.net/poem_qianmo/article/details/19925819】

 

文章链接: http://blog.csdn.net/poem_qianmo/article/details/19925819

作者:毛星云(浅墨)    邮箱: happylifemxy@163.com 

写作当前博文时配套使用OpenCV版本:2.4.8

 

 

之前啃了不少OpenCV的官方文档,发现如果了解了一些OpenCV整体的模块架构后,再重点学习自己感兴趣的部分的话,就会有一览众山小的感觉,于是,就决定写出这篇文章,作为启程OpenCV系列博文的第二篇。

 

至于OpenCV组件结构的研究方法,我们不妨管中窥豹,通过opencv安装路径下include目录里面头文件的分类存放,来一窥OpenCV这些年迅猛发展起来的庞杂组件架构。

我们进入到D:\ProgramFiles\opencv\build\include目录,可以看到有opencv和opencv2这两个文件夹。显然,opencv这个文件夹里面包含着旧版的头文件。而opencv2这个文件夹里面包含着具有时代意义的新版OpenCV2系列的头文件。

 一览众山小:OpenCV 2.4.8组件结构全解析

在opencv这个文件夹里面,也就是D:\Program Files\opencv\build\include\opencv目录下,可以看到如下的各种头文件。这里面大概就是opencv 1.0最核心的,而且保留下来的内容的头文件,可以把它们整体理解为一个组件。

 一览众山小:OpenCV 2.4.8组件结构全解析


 再来看看我们重点关注的opencv2这边,在D:\ProgramFiles\opencv\build\include\opencv2目录下,我们可以看到这些文件夹:

一览众山小:OpenCV 2.4.8组件结构全解析



我们灵机一动,发现下面有个叫opencv_modules.hpp的hpp文件,一看就知道里面存放的是opencv2中的新模块构造相关的说明代码,打开一看,果不其然,定义的是OpenCV2所有组件的宏:


[cpp] view plaincopyprint?一览众山小:OpenCV 2.4.8组件结构全解析一览众山小:OpenCV 2.4.8组件结构全解析

  1. /* 
  2.  *     ** File generated automatically, do not modify ** 
  3.  * 
  4.  *This file defines the list of modules available in current build configuration 
  5.  * 
  6.  * 
  7. */  
  8.    
  9. #define HAVE_OPENCV_CALIB3D  
  10. #define HAVE_OPENCV_CONTRIB  
  11. #define HAVE_OPENCV_CORE  
  12. #define HAVE_OPENCV_FEATURES2D  
  13. #define HAVE_OPENCV_FLANN  
  14. #define HAVE_OPENCV_GPU  
  15. #define HAVE_OPENCV_HIGHGUI  
  16. #define HAVE_OPENCV_IMGPROC  
  17. #define HAVE_OPENCV_LEGACY  
  18. #define HAVE_OPENCV_ML  
  19. #define HAVE_OPENCV_NONFREE  
  20. #define HAVE_OPENCV_OBJDETECT  
  21. #define HAVE_OPENCV_OCL  
  22. #define HAVE_OPENCV_PHOTO  
  23. #define HAVE_OPENCV_STITCHING  
  24. #define HAVE_OPENCV_SUPERRES  
  25. #define HAVE_OPENCV_TS  
  26. #define HAVE_OPENCV_VIDEO  
  27. #define HAVE_OPENCV_VIDEOSTAB  


 

OK,就不多客套了,下面就是OpenCV的所有模块介绍,按照顺序来:

 

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

 

【contrib】——也就是Contributed/Experimental Stuf的缩写, 该模块包含了一些最近添加的不太稳定的可选功能,不用去多管。2.4.8里的这个模块有新型人脸识别,立体匹配,人工视网膜模型等技术。

 

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

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


 【imgproc——Image和Processing这两个单词的缩写组合。图像处理模块,这个模块包含了如下内容:

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

 

【features2d】 ——也就是Features2D, 2D功能框架 ,包含如下内容:

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


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

  • 快速近似最近邻搜索
  • 聚类

 

【gpu】——运用GPU加速的计算机视觉模块

 

【highgui】——也就是high gui,高层GUI图形用户界面,包含媒体的I / O输入输出,视频捕捉、图像和视频的编码解码、图形交互界面的接口等内容

 

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

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

 

【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

【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,视频稳定相关的组件,官方文档中没有多作介绍,不管它了。


 

看到到这里,相信大家已经对OpenCV的模块架构设计有了一定的认识。

OpenCV其实就是这么多模块作为代码容器组合起来的一个SDK而已,没什么稀奇的,对吧。

 

最后配张图,养养眼:

一览众山小:OpenCV 2.4.8组件结构全解析


好了,OpenCV的组件结构介绍大概就是这些。

下篇文章见 :)

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment