https://blog.youkuaiyun.com/weixin_42029090/article/details/80618208
各opencv模块
一、core 模块
1、Mat - 基本图像容器
Mat 是一个类,由两个数据部分组成:矩阵头(包含矩阵尺寸,存储方法,存储地址等信息)和一个指向存储所有像素值的矩阵(根据所选存储方法的不同矩阵可以是不同的维数)的指针。
创建Mat对象方法:
1->Mat() 构造函数:
Mat M(2,2, CV_8UC3, Scalar(0,0,255));
int sz[3] = {2,2,2};
Mat L(3,sz, CV_8UC(1), Scalar::all(0));
2->Create() function: 函数
M.create(4,4, CV_8UC(2));
3-> 初始化zeros(), ones(), :eyes()矩阵
Mat E = Mat::eye(4, 4, CV_64F);
Mat O = Mat::ones(2, 2, CV_32F);
Mat Z = Mat::zeros(3,3, CV_8UC1);
4->用逗号分隔的初始化函数:
Mat C = (Mat_<double>(3,3) << 0, -1, 0, -1, 5, -1, 0, -1, 0);