Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

step1() returns (width of a single matrix row in bytes) / (element size in bytes).

step1() returns (width of a single matrix row in bytes) / (element size in bytes).

Example:

cv::Mat m(7, 2, CV_UC1);
  m.elemSize():  1
  m.elemSize1(): 1
  m.step1():     2

cv::Mat m(7, 2, CV_UC1);
  m.elemSize():  3
  m.elemSize1(): 1
  m.step1():     6

cv::Mat m(7, 2, CV_32FC1);
  m.elemSize():  4
  m.elemSize1(): 4
  m.step1():     2

cv::Mat m(7, 2, CV_32FC3);
  m.elemSize():  12
  m.elemSize1(): 4
  m.step1():     6
click to hide/show revision 3
Fixed the second matrix type, should be CV_UC3.

step1() returns (width of a single matrix row in bytes) / (element size in bytes).

Example:

cv::Mat m(7, 2, CV_UC1);
  m.elemSize():  1
  m.elemSize1(): 1
  m.step1():     2

cv::Mat m(7, 2, CV_UC1);
CV_UC3);
  m.elemSize():  3
  m.elemSize1(): 1
  m.step1():     6

cv::Mat m(7, 2, CV_32FC1);
  m.elemSize():  4
  m.elemSize1(): 4
  m.step1():     2

cv::Mat m(7, 2, CV_32FC3);
  m.elemSize():  12
  m.elemSize1(): 4
  m.step1():     6