1.图片的读取与显示
#include<iostream>
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
string path = "C:\\Users\\四明\\Pictures\\优快云_1650762684526.jpg";
//图片的读取
Mat img = imread(path,IMREAD_ANYCOLOR);
if (img.empty())
{
cout << "无法加载图片" << endl;
return -1;
}
namedWindow("image", WINDOW_FREERATIO);//创建窗口
imshow("image", img);//图片的显示
waitKey(0);
destroyAllWindows();//销毁
return 0;
}