#include<opencv2\opencv.hpp>
#include<iostream>
#include<math.h>
using namespace cv;
int main()
{
Mat src = imread("C:/Users/asus/Desktop/tupian/1.jpg");
if (src.empty())
{
printf("could not load image...\n");
return -1;
}
namedWindow("opencv setup demo", WINDOW_AUTOSIZE);
imshow("opencv setup demo", src);
namedWindow("output window", WINDOW_AUTOSIZE);
Mat output_image;
cvtColor(src, output_image, COLOR_BGR2HLS);
imshow("output window", output_image);
imwrite("C:/Users/asus/Desktop/tupian/3.jpg", output_image);
waitKey(0);
return 0;
}
opencv c++图片读取显示保存
最新推荐文章于 2024-09-16 18:09:13 发布