1.opencv做应用时候,该怎么样添加头文件呢,添加怎么样的头文件呢?
#include<opencv2/opencv.hpp>这个里面包括了opencv2下面的所有hpp头文件
2.opencv万能头文件
- #ifndef _PREDEP_H_
- #define _PREDEP_H_
- #pragma once
- #include "targetver.h"
- #include <stdio.h>
- #include <tchar.h>
- #include <iostream>
- #include "opencv2/core/version.hpp"
- #include "opencv2/imgproc/imgproc.hpp"
- #include "opencv2/highgui/highgui.hpp"
- #include "opencv2/calib3d/calib3d.hpp"
- #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION)
- #ifdef _DEBUG
- #define cvLIB(name) "opencv_" name CV_VERSION_ID "d"
- #else
- #define cvLIB(name) "opencv_" name CV_VERSION_ID
- #endif
- #pragma comment( lib, cvLIB("core") )
- #pragma comment( lib, cvLIB("imgproc") )
- #pragma comment( lib, cvLIB("highgui") )
- #pragma comment( lib, cvLIB("flann") )
- #pragma comment( lib, cvLIB("features2d") )
- #pragma comment( lib, cvLIB("calib3d") )
- #endif