注意step是一个数组,随着维度会进行扩展,定义了矩阵的布局。
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc, const char * argv[]) {
// insert code here...
const char filename[] = "/Users/linwang/Downloads/Lena.jpg";
Mat Img = imread(filename);
cout<<"三维图像的维度:"<<Img.dims<<endl;
cout<<"三维图像的通道数:"<<Img.channels()<<endl;
cout<<"三维图像的宽:"<<Img.rows<<endl;
cout<<"三维图像的高:"<<Img.cols<<endl;
cout<<"数据类型的大小 "<<Img.elemSize1()<<endl;
cout<<"存放一个列元素的大小:"<<Img.elemSize()<<endl;
cout<<" Img.step[0] = "&l