OpenCV学习笔记(二):对opencv.hpp头文件的认识

1.opencv.hpp位置

该头文件位于*\opencv\sources\include\opencv2

比如下面就是该文件在我的机器上位置:
D:\opencv2.4.10\opencv\sources\include\opencv2\opencv.hpp

2.opencv.hpp内容

通常在查看opencv库文件时,转到定义(F12),我们会发现库文件开头都会声明

#include "opencv2/core/version.hpp"
#ifndef __OPENCV_ALL_HPP__
#define __OPENCV_ALL_HPP__

#include "opencv2/core/core_c.h"
#include "opencv2/core/core.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/photo/photo.hpp"
#include "opencv2/video/video.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/ml/ml.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp"

#endif

如果仔细观察,我们就可以看到,在该头文件中已经包含了OpenCV中各个模块的头文件,换句话说我们在一般情况下,只需要引用

#include

可以显著的简化代码。


仅供学习交流,如有错误,敬请指正,谢谢!!!

你可能感兴趣的:(OpenCV)