OpenCV中Mat对象的标题是什么意思?

时间:2015-06-25 09:47:40

标签: c++ opencv mat

我是C ++编程和OpenCV的新手。我在OpenCV中经历了关于Mat类的this教程。它说“每个Mat对象都有自己的标题”并多次使用术语标题。我不确定标题在这种情况下的含义是什么?

我尝试使用Google搜索并找到this页面,上面写着:“Mat基本上是一个包含两个数据部分的类:矩阵标题(包含矩阵的 size 等信息, 用于存储的方法,在哪个地址是存储的矩阵,依此类推)..........“

现在我明白了尺寸意味着什么,但我有两个问题需要澄清:

  1. “用于存储的方法”是指什么? Mat类中的哪个成员表示这个?
  2. 地址是否与Mat类中的“datastart”成员对应?
  3. 谢谢!

1 个答案:

答案 0 :(得分:1)

As per the OpenCV documentation:

Mat is basically a class with two data parts: the matrix header (containing information such as the size of the matrix, the method used for storing, at which address is the matrix stored, and so on) and a pointer to the matrix containing the pixel values (taking any dimensionality depending on the method chosen for storing). The matrix header size is constant, however the size of the matrix itself may vary from image to image and usually is larger by orders of magnitude.