ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to Save sensor_msgs/Image

asked 2014-10-02 12:00:37 -0600

K. Zeng gravatar image

I've got Gazebo 2.2.3 and ROS Indigo set up, and I have a plugin that allows a stereo camera to publish images from Gazebo to ROS. I've run rosbag with the image topics, and it has no problems recording or playing them. The issue now is that I need to somehow either save the images themselves or have access to the pointers for the camera images. Can someone give me some pointers on how to do so, preferably via C++ code?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-04 19:31:50 -0600

tfoote gravatar image

If you use cv_bridge you can then use all of OpenCV which includes operating on and saving images.

edit flag offensive delete link more



imwrite as explained here would do the job, in C++, since ROS supports OpenCV.

kunaltyagi gravatar image kunaltyagi  ( 2014-10-05 16:31:36 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2014-10-02 12:00:37 -0600

Seen: 2,200 times

Last updated: Oct 04 '14