需要调用到opencv的什么功能,就在代码头提前引用好对应的头文件。
所有的头文件都可以在include/opencv2/
文件夹找到。
常见头文件:
#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"
具体作用:
其中,最常引用的头文件:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
由于opencv.hpp
中已经包含了OpenCV中各模块的头文件,所以也可以只引用该头文件:
#include <opencv2/opencv.hpp>
[1] OpenCV概要介绍 [2] OpenCV学习(3) OpenCV框架
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有