首页 > 代码库 > OpenCV Code: Operations on Mat element
OpenCV Code: Operations on Mat element
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。