OpenCV基础课程笔记02加载保存修改图像
写在前面
这节课……水……讲了一些前言类似的吧,个人觉得没什么太重要的东西。
代码
#include <iostream>
#include<opencv2\opencv.hpp>
#include<opencv2\highgui\highgui.hpp>
using namespace cv;
int main() {
Mat taeyeon = imread("A:专用\\TestForTheCV\\tae.jpg", IMREAD_GRAYSCALE);//作为灰度图读入,另一个:IMREAD_COLOR 作为RGB
imshow("第二课", taeyeon);
imwrite("A:专用\\TestForTheCV\\tae灰度图像.jpg",taeyeon);
waitKey(0);
return 0;
}
}
运行结果



浙公网安备 33010602011771号