本篇具体讨论OpenCV库的头文件;
头文件反映了 OpenCV 的新模块化结构。
OpenCV中主要的头文件是include “opencv2/opencv.hpp”,它可以调用每个 Opencv 模块的头文件;
#include “opencv2/core/core_c.h”
老的 C 数据结构和算术例程
Old C data structures and arithmetic routines
#include “opencv2/core/core.hpp”
新C++数据结构和算术例程
New C++ data structures and arithmetic routines
#include “opencv2/flann/miniflann.hpp”
近似最近的邻域匹配函数
Approximate nearest neighbor matching functions
#include “opencv2/imgproc/imgproc_c.h”
旧 C 图像处理功能
Old C image processing functions
#include “opencv2/imgproc/imgproc.hpp”
新的C++图像处理功能
New C++ image processing functions
#include “opencv2/video/photo.hpp”
特定于处理和恢复照片的算法
Algorithms specific to handling and restoring photographs
#include “opencv2/video/video.hpp”
视频跟踪和后台分割例程
Video tracking and background segmentation routines
#include “opencv2/features2d/features2d.hpp”
二维特征跟踪支持
Two-dimensional feature tracking support
#include “opencv2/objdetect/objdetect.hpp”
级联人脸检测器;潜在SVM;HoG;平面片检测器;
Cascade face detector; latent SVM; HoG; planar patch detector
#include “opencv2/calib3d/calib3d.hpp”
校准和立体声
Calibration and stereo
#include “opencv2/ml/ml.hpp”
机器学习:聚类、模式识别
Machine learning: clustering, pattern recognition
#include “opencv2/highgui/highgui_c.h”
旧 C 图像显示、滑块、鼠标交互、I/O
Old C image display, sliders, mouse interaction, I/O
#include “opencv2/highgui/highgui.hpp”
新C++图像显示、滑块、按钮、鼠标、I/O
New C++ image display, sliders, buttons, mouse, I/O
#include “opencv2/contrib/contrib.hpp”
用户贡献的代码:肉检测、模糊平均移位跟踪、旋转图像、自相似功能
User-contributed code: flesh detection, fuzzy mean-shift tracking, spin images,
self-similar features
你可以使用#include “opencv.hpp” 包括任何和每一个可能的 OpenCV 函数,但它会减慢编译时间。
如果仅使用图像处理函数,仅包括 opencv2/imgproc/imgproc.hpp的话,则编译时间将更快。
例如,imgproc.hpp位于…/modules/imgproc/include/opencv2/imgproc/
imgproc.hpp.
同样,函数本身的源文件位于其相应的 src 目录下。
例如,imgproc模块中的cv::Canny() 函数就位于 …/modules/improc/src/canny.cpp.
可以使用 opencv2/legacy/legacy.hpp 包括旧版代码,例如:旧版的 Blob 跟踪、隐马尔科夫模型 (HMM)人脸检测、冷凝跟踪器和 Eigen 对象,该对象位于 …/modules/legacy/include/opencv2/legacy/legacy.hpp。
You can include legacy code such as the older blob tracking, Hidden Markov Model (HMM) face detection, condensation tracker,and Eigen objects using opencv2/legacy/legacy.hpp, which is located
in …/modules/legacy/include/opencv2/legacy/legacy.hpp.
OpenCV在线学习资源: