Conversion of rawdepth to depth images

689 views
Skip to first unread message

Shravan M

unread,
Dec 16, 2014, 11:17:16 AM12/16/14
to ros-by-...@googlegroups.com
I have a Bagfile containing Raw depth and RGB data. I converted the RGB data into images using the tutorial
http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data
But when I used the same for converting raw depth to images, I get an error stating " cannot convert 32FC1 to RGB8".
This is my launch file:
<launch>
     <node pkg="rosbag" type="play" name="rosbag" args="-d 2 $(find image_view)/test.bag"/>
     <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
       <remap from="image" to="/camera/depth_registered/image_rect"/>
     </node>
</launch>

I went through Google for various suggestions given to do the same but I being a beginner find most of the solution vague or misleading and I end up confusing myself.

I need to know whether my approach was right or should I do something else? If so what should I do exactly.Please  help me through this

Patrick Goebel

unread,
Dec 18, 2014, 10:29:50 AM12/18/14
to ros-by-...@googlegroups.com
Hi Shravan,

This thread
on answers.ros.org gives a good explanation why this doesn't work.  Basically, the extract_images node does not support the required image conversion from the raw depth image to the JPEG format that is output.

As suggested on answers.ros.org, you could write another node (or find a node that someone else has written) that subscribes to the depth image and converts it to the appropriate format for use with extract_images.

--patrick

Shravan M

unread,
Dec 18, 2014, 12:53:04 PM12/18/14
to ros-by-...@googlegroups.com
I tried writing a node but my rosbag contains depth values which uses only one channel while image_view wants RGB8 format only (which is a three channel type). I converted 32FC1to 16UC1 as well as 8UC1 but still says it cannot be converted. Is there any way to extract gray images using image_view?

Patrick Goebel

unread,
Dec 19, 2014, 3:12:41 PM12/19/14
to ros-by-...@googlegroups.com
Hi Shravan,

I'm afraid these image conversion issues are extending beyond my area of expertise so I would suggest posting your questions on http://answers.ros.org or even the OpenCV forum.  It might help if you begin with the end result you are trying to achieve.  Sorry I couldn't me more help!

--patrick
--
You received this message because you are subscribed to the Google Groups "ros-by-example" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-by-exampl...@googlegroups.com.
Visit this group at http://groups.google.com/group/ros-by-example.
For more options, visit https://groups.google.com/d/optout.

Shravan M

unread,
Dec 19, 2014, 11:24:45 PM12/19/14
to ros-by-...@googlegroups.com
No problem Patrick, Thanks a lot for your suggestions :)
Reply all
Reply to author
Forward
0 new messages