c++ - OpenCV 中 Mat 对象的 header 是什么意思?

标签 c++ opencv mat

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

我尝试使用谷歌搜索并找到了 this页面上写着:“Mat 基本上是一个包含两个数据部分的类:矩阵头(包含矩阵的大小用于存储的方法等信息,位于矩阵存储在哪个地址等)…………”

现在我明白了大小是什么意思,但我有两个问题需要澄清:

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

谢谢!

最佳答案

根据 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.

关于c++ - OpenCV 中 Mat 对象的 header 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31046805/

相关文章:

c++ - 没有累积缓冲区的 OpenGL 运动模糊

c++ - opencv/c++ 我如何只检测之前检测到的方形区域内的关键点

python - Python中的Null或None函数

c++ - opencv mat与CImage之间的转换

c++ - 为什么这个 while 循环不会停止?

c++ - 将 boost IOStreams 与 std::ostream_iterator 结合使用

c++ - 遍历 function_traits 参数

c++ - Mac 上的 OpenCV Contrib 模块安装

java - 使用 CallVoidMethod 将 mat 数组从 native 代码传递到 java 代码

c++ - 如何使函数可以在 OpenCV 中处理不同类型的图像