every blog every motto: You can do more than you think.
https://blog.csdn.net/weixin_39190382?type=blog
0. 前言
有关c++操作opencv记录
1. 正文
1.1 图像读取、显示、保存
// 读取、显示、保存图像#include <opencv2/opencv.hpp>
#include <iostream>using namespace cv;
using namespace std;int main(){Mat img; // 创建空图像img = imread("/home/v/home.png") ;if(img.empty()){cout << "读取图片失败" << endl;return -1;}namedWindow("home"); // 无这行窗口大小不能改变imshow("home", img);imwrite("a.png",img);waitKey(0);return 0;
}