很多的博客直接将原网址复制粘贴过来,这里做一个整理,另外原网址是:https://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/Image.html
该消息意味包含未压缩的图像,且(0,0)在图像的左上角。
参数大体含义如下:
- header:设定header,1.时间戳是图像获取的时间。2.frame_id是相机的光学帧3.帧的原点是光学相机的中心4.+x为图像向右5.+y为图像向下6.+z为指向图像平面
- uint32 height:图片高度,即行数
- uint32 width:图片宽度,即列数
- string encodeing:像素编码(通道含义、排序、大小)
- uint8 is_bigendian:数据是否是双端
- uint32 step:全行长度(字节)
- uint8[] data:实际矩阵数据
首先拿VINS-Mono的代码举例:
sensor_msgs::Image img;
img.header = img_msg->header;
img.height = img_msg->height;
img.width = img_msg->width;
img.is_bigendian = img_msg->is_bigendian;
img.step = img_msg->step;
img.data = img_msg->data;
img.encoding = "mono8";
Original: https://blog.csdn.net/I_canjnu/article/details/124855613
Author: 出门左拐是海
Title: sensor_msgs::Image消息及其参数
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/720387/
转载文章受原作者版权保护。转载请注明原作者出处!