First time here? Check out the FAQ!


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

Turn a point cloud into an image with Python

asked Jul 6 '11

Poofjunior gravatar image

updated Jan 28 '14

ngrennan gravatar image

Hi, everyone,

Recently, I tried to run through the pcl_ros tutorial to convert a point cloud from a Kinect to an image. My hope is to be able to do the exact same thing in Python, not C++, and then work with the image using the OpenCV Python interface.

here's the tutorial link: http://www.ros.org/wiki/pcl_ros/Tutor...

I hit a small snag, though. It seems like the tutorial is referencing a Ros Topic from openni_camera called /camera/depth/points2, but I can't seem to find this topic in list of topics published by openni_camera.

Rather, I found: /camera/depth/points, but this doesn't seem to generate an image when I make this change in the tutorial.

Will getting the image from /camera/depth/points2 be necessary to fulfill my overall goal?

Also, are there any other ways to easily convert a Point Cloud from the Kinect to an image in Python? Many Thanks in advance for everyone's words of wisdom!

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered Jul 6 '11

fergs gravatar image

There are currently no PCL-python bindings, so there is no single function to convert a point cloud into an image. You can however subscribe to /camera/depth/image, which is already an image and has 32-bit float valued pixels (values are in meters). It can be converted easily into a cvMat using cv_bridge (see this post for further details).

Preview: (hide)
2

answered Dec 28 '15

misaugstad gravatar image

For anyone coming across this now: Python bindings for PCL were released in February of 2013 by Strawlab at http://strawlab.github.io/python-pcl/

Preview: (hide)

Question Tools

Stats

Asked: Jul 6 '11

Seen: 6,993 times

Last updated: Jul 06 '11