opencv笔记

1.图片的读取与显示

#include
#include

using namespace std;
using namespace cv;

int main()
{
	string path = "C:\\Users\\四明\\Pictures\\CSDN_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;
}

你可能感兴趣的:(opencv笔记,笔记,c++,opencv)