Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV IO Mat #473

Open
junxnone opened this issue Aug 27, 2024 · 0 comments
Open

OpenCV IO Mat #473

junxnone opened this issue Aug 27, 2024 · 0 comments

Comments

@junxnone
Copy link
Owner

OpenCV Mat

elemSize

  • 元素大小
  • 元素指 CV_8UC1/CV_8UC3/CV_32FC1/...
  • elemSize1 : elemSize 一个通道 size
TYPE elemSize elemSize1
CV_8UC1 1 1
CV_8UC3 3 1
CV_16UC1 2 2
CV_16UC3 6 2
CV_32FC1 4 4
CV_32FC4 16 4
... ... ...

step(stride)

  • 存储着各个维度占用的内存块的大小
  • step[0] = cols * elemSize
  • step[1] = elemSize
  • step1: 以 elemSize1 为单位

.at

  • 访问元素
  • img.at(y, x)

.ptr

  • 访问矩阵某行, 返回指向矩阵某行开始的地址
  • img->ptr(n)

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant