ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Convert pointcloud to image

asked 2012-12-08 00:56:49 -0500

KARTHIK MURUGAN gravatar image

updated 2014-01-28 17:14:30 -0500

ngrennan gravatar image

hi, i have a bagfile with velodyne packets in it. I want to convert this point cloud into an image or a range image. Anyone please help me how to convert it.

i went through the documentation in Tutorials/CloudToImage for converting pointcloud to image.I used the node "convert_pointcloud_to_image" But when i tried it i get an error :-

Error in converting cloud to image message: No rgb field!!

please help me out with this error.Is there any documentation for converting to range image ?

edit retag flag offensive close merge delete


Followup: is it possible to generate a greyscale image?

benabruzzo gravatar image benabruzzo  ( 2015-02-20 13:12:59 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-12-08 05:33:55 -0500

From the pcl::toROSMsg documentation:

Copy the RGB fields of a PointCloud2 msg into sensor_msgs::Image format.

It appears your pointcloud has no RGB data attached to it. How did you record it?

edit flag offensive delete link more

answered 2012-12-08 12:52:47 -0500

Ben_S gravatar image

I think that this tutorial looks promising and might just describe what you are looking for. The method you are trying would also require a dense pointcloud, which the Velodynes do not seem to supply.

edit flag offensive delete link more


thank you Ben. I tried it from the link u mentioned. The range image seems to be jittery(size of image changing randomly but ofcourse visible) when i publish a stream of pointcloud from bagfile. Is there any documentation for converting to just a 2D image (representing the 3D shapes from pointcloud)

KARTHIK MURUGAN gravatar image KARTHIK MURUGAN  ( 2012-12-09 02:18:09 -0500 )edit

Are the beams of the velodyne evenly spaced vertically? Maybe you can extend the velodyne node to not add the single measurements to an pointcloud but instead project them into an image. (Starting from the raw velodyne packets in making an unpack method for image as target?)

Ben_S gravatar image Ben_S  ( 2012-12-09 03:05:43 -0500 )edit

Question Tools

1 follower


Asked: 2012-12-08 00:56:49 -0500

Seen: 8,127 times

Last updated: Dec 08 '12