OpenCV__elemSize

  • elemSize
    • 矩阵一个元素占用的字节数,例如:type是CV_16SC3,那么elemSize = 3 * 16 / 8 = 6 bytes
  • elemSize1
    • 矩阵元素一个通道占用的字节数,例如:type是CV_16CS3,那么elemSize1 = 16 / 8 = 2 bytes = elemSize / channels

示例

    Mat img(3, 4, CV_16UC4, Scalar_<uchar>(1, 2, 3, 4));

    cout << img << endl;
    cout << "elemSize:" << img.elemSize() << endl;
    cout << "elemSize1:" << img.elemSize1() << endl;

输出

原文地址:https://www.cnblogs.com/narjaja/p/10300767.html