码迷,mamicode.com
首页 > 其他好文 > 详细

OpenCV Code: Operations on Mat element

时间:2016-10-10 02:03:24      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:

cv::Mat img = cv::imread("image.jpg");

Method 1:

img.at<uchar>(i, j, k)

Method 2:

img.at<Vec3b>(i, j)[0]

 

Note: definitions for Vec

typedef Vec<uchar, 2> Vec2b;
typedef Vec<uchar, 3> Vec3b;
typedef Vec<uchar, 4> Vec4b;

typedef Vec<short, 2> Vec2s;
typedef Vec<short, 3> Vec3s;
typedef Vec<short, 4> Vec4s;

typedef Vec<int, 2> Vec2i;
typedef Vec<int, 3> Vec3i;
typedef Vec<int, 4> Vec4i;

typedef Vec<float, 2> Vec2f;
typedef Vec<float, 3> Vec3f;
typedef Vec<float, 4> Vec4f;
typedef Vec<float, 6> Vec6f;

typedef Vec<double, 2> Vec2d;
typedef Vec<double, 3> Vec3d;
typedef Vec<double, 4> Vec4d;
typedef Vec<double, 6> Vec6d;

 

OpenCV Code: Operations on Mat element

标签:

原文地址:http://www.cnblogs.com/JimmyTY/p/5944340.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!