#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat img = imread("D:\\壁纸.jpg");
if (img.empty())
{
cout << "Could not find the image!" << endl;
return -1;
}
imshow("testimg", img);
waitKey(0);
return 0;
}
此代码段报错:
同样的代码段,包含文件改写为:#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>,编译可以通过,这是什么原因,怎么解决呢?请赐教
OpenCV在官网下载的4.0版本,VS2019版本