opencv.hpp文件

来源:互联网 发布:亚投行薪水待遇知乎 编辑:程序博客网 时间:2024/05/19 12:37
下面是opencv.hpp的源码:
#ifndef OPENCV_ALL_HPP#define OPENCV_ALL_HPP// File that defines what modules where included during the build of OpenCV// These are purely the defines of the correct HAVE_OPENCV_modulename values#include "opencv2/opencv_modules.hpp"// Then the list of defines is checked to include the correct headers// Core library is always included --> without no OpenCV functionality available#include "opencv2/core.hpp"// Then the optional modules are checked#ifdef HAVE_OPENCV_CALIB3D#include "opencv2/calib3d.hpp"#endif#ifdef HAVE_OPENCV_FEATURES2D#include "opencv2/features2d.hpp"#endif#ifdef HAVE_OPENCV_FLANN#include "opencv2/flann.hpp"#endif#ifdef HAVE_OPENCV_HIGHGUI#include "opencv2/highgui.hpp"#endif#ifdef HAVE_OPENCV_IMGCODECS#include "opencv2/imgcodecs.hpp"#endif#ifdef HAVE_OPENCV_IMGPROC#include "opencv2/imgproc.hpp"#endif#ifdef HAVE_OPENCV_ML#include "opencv2/ml.hpp"#endif#ifdef HAVE_OPENCV_OBJDETECT#include "opencv2/objdetect.hpp"#endif#ifdef HAVE_OPENCV_PHOTO#include "opencv2/photo.hpp"#endif#ifdef HAVE_OPENCV_SHAPE#include "opencv2/shape.hpp"#endif#ifdef HAVE_OPENCV_STITCHING#include "opencv2/stitching.hpp"#endif#ifdef HAVE_OPENCV_SUPERRES#include "opencv2/superres.hpp"#endif#ifdef HAVE_OPENCV_VIDEO#include "opencv2/video.hpp"#endif#ifdef HAVE_OPENCV_VIDEOIO#include "opencv2/videoio.hpp"#endif#ifdef HAVE_OPENCV_VIDEOSTAB#include "opencv2/videostab.hpp"#endif#ifdef HAVE_OPENCV_VIZ#include "opencv2/viz.hpp"#endif// Finally CUDA specific entries are checked and added#ifdef HAVE_OPENCV_CUDAARITHM#include "opencv2/cudaarithm.hpp"#endif#ifdef HAVE_OPENCV_CUDABGSEGM#include "opencv2/cudabgsegm.hpp"#endif#ifdef HAVE_OPENCV_CUDACODEC#include "opencv2/cudacodec.hpp"#endif#ifdef HAVE_OPENCV_CUDAFEATURES2D#include "opencv2/cudafeatures2d.hpp"#endif#ifdef HAVE_OPENCV_CUDAFILTERS#include "opencv2/cudafilters.hpp"#endif#ifdef HAVE_OPENCV_CUDAIMGPROC#include "opencv2/cudaimgproc.hpp"#endif#ifdef HAVE_OPENCV_CUDAOBJDETECT#include "opencv2/cudaobjdetect.hpp"#endif#ifdef HAVE_OPENCV_CUDAOPTFLOW#include "opencv2/cudaoptflow.hpp"#endif#ifdef HAVE_OPENCV_CUDASTEREO#include "opencv2/cudastereo.hpp"#endif#ifdef HAVE_OPENCV_CUDAWARPING#include "opencv2/cudawarping.hpp"#endif#endif

在该头文件中已经包含了OpenCV中各个模块的头文件,换句话说我们在一般情况下,只需要引用:
#include <opencv2/opencv.hpp>
便不需要再引用诸如:
#include <opencv2/core/core.hpp>#include <opencv2/highgui.hpp>
因此可以在很大程度上简化代码。
0 0