I have connected the L515 Lidar camera with my computer over the ROS network. I am getting an image from the ROS topic "/camera/depth/image_rect_raw" which is of the type "sensor_msgs/Image".
If I look at one of the topics in MATLAB it looks like this:
Header: [1×1 Header]
Data: [614400×1 uint8]
Now I take this msg and convert it into two pictures in the following manner:
imgData = msg.Data;
imgH = msg.Height;
imgW = msg.Width;
%Create blank image output with required size
img = zeros(msg.Width,msg.Height,2);
imgD = reshape(imgData(1:2:end),imgW,imgH)';
imgC = reshape(imgData(2:2:end),imgW,imgH)';
This is how my depth image imgD looks:
This is how imgC looks:
Now my question is why am I getting 8 bit depth image? Shouldn't it be 16 bit? Why am I getting 480x640 pixels? Secondly, how do I convert the value of the pixels from the 0-255 to meters.
Please let me know if I am doing something wrong.
Thanks for the help in advance.!!
Please sign in to leave a comment.