- step[0]是矩陣中一行元素的字節數
- step[1]是矩陣中一個元素的字節數(elemSize)
- step1 = step / elemSize1,elemSize1是元素的每個通道所占的字節數
- step1(0)是矩陣一行元素的通道數(不是很貼切)
- step1(1)是矩陣一個元素的通道數(channel())
示例
Mat img(3, 4, CV_16UC4, Scalar_<uchar>(1, 2, 3, 4));
cout << img << endl;
cout << "step:" << img.step << endl;
cout << "step[0]:" << img.step[0] << endl;
cout << "step[1]:" << img.step[1] << endl;
cout << "step1(0):" << img.step1(0) << endl;
cout << "step1(1):" << img.step1(1) << endl;
結果

