OpenCv 中Mat对象数据类型

Mat src = imread("E:/cats.jpg"); // 加载图像
int width = src.cols; // 宽
int height = src.rows;  // 高
int dim = src.channels(); // 通道数
int img_depth = src.depth(); //深度
int img_type = src.type();  //数据类型

depth的取值:
CV_8U   0

CV_8S 1
CV_16U 2
CV_16S 3
CV_32S 4
CV_32F 5
CV_64F 6
CV_USRTYPE1 7

type取值

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/pj_wxyjxy/article/details/128914536