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

Visualize pointcloud in ros

asked 2016-10-27 08:28:48 -0500

jtim gravatar image

Hello I have now used gpu::reprojectImageTo3D on a found disparity image and received cv::Mat of the pointcloud. I would now like to display this pointcloud.

I could not find any method inside OpenCV, I therefore found RViz and/or pcl.

#I see two ways: Method 1:

Convert the found pointcloud from OpenCV to sensor_msgs/PointCloud2 and then publish this topic. Allowing me to view it through RViz.

Issues: I am running this on embedded platform Jetson TX1 and I have read that RViz is not performing that well on the board. Furhtermore I cannot find any explanation for the conversion between the two types.

Method 2:

Use pcl to display the pointcloud from inside the node just for debug purposes.

Issues: I am however unsure if this is even possible.

#Question How do I display a pointcloud found in OpenCV?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-03-01 21:39:16 -0500

nhanph gravatar image

In the source code of stereo_image_proc from ROS, you can see the part that converts from cv::Mat to pointCloud2 message. You can refer to that part and modify as you see fit.


edit flag offensive delete link more

answered 2016-10-28 03:33:55 -0500

mpjansen gravatar image

Hey jtim,

I have little experience with this, but from a couple of years ago I remember looking at:

the cv_bridge can cast image back and forth between opencv and ROS types, visualizing then becomes as simple as creating a publisher and rviz node. Although you indicate that RViz might not work properly, in which case you might be able to try to offload visualization to a normal PC running ROS?

Good luck!

edit flag offensive delete link more


Hey you are right. I allready use the cv_bridge for converting image messages. I however have not found the usecase of converting them to pointcloud2 messages. The offloading does not seem possible since the company is normally focussed on windows pcs and the lenovo pc is locked for installing linux

jtim gravatar image jtim  ( 2016-10-28 05:54:14 -0500 )edit

Question Tools

1 follower


Asked: 2016-10-27 08:28:48 -0500

Seen: 1,665 times

Last updated: Oct 27 '16