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

sensor_msgs/CompressedImage decompression

asked 2013-01-04 08:15:50 -0600

pacifica gravatar image

updated 2014-01-28 17:14:44 -0600

ngrennan gravatar image

Hi all!

I cannot use this type of data: sensor_msgs/CompressedImage. I've trasformed the originale image stream with the "image_transport" package, to send image over internet. Now i need to trasform this compressed image in a usable image (a sensor_msgs/Image or somethink like).

Any suggestions??

Thanks a lot!

edit retag flag offensive close merge delete

Comments

Are you attempting to decompress the raw bytes outside of ROS or simply to subscribe to a compressed image stream using ROS on a remote machine?

Eric Perko gravatar image Eric Perko  ( 2013-01-04 08:40:32 -0600 )edit

I need to use image stream in ros. I hope to transform compressImage data in a CvMat :D or any opencv data format.

pacifica gravatar image pacifica  ( 2013-01-04 22:51:16 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-01-05 01:25:07 -0600

pacifica gravatar image

SOLVED:

With instruction: cv::Mat matrix = cv::imdecode(cv::Mat(buffer_image_compressed),1)

it's possibile to use the compressed image in opencv!

edit flag offensive delete link more

Comments

2

what type is buffer_image_compressed? sensor_msgs::CompressedImage?

kabamaru gravatar image kabamaru  ( 2013-01-18 00:25:38 -0600 )edit
2

answered 2013-01-05 12:45:16 -0600

Chad Rockey gravatar image

If you're using ROS check out this answer: http://answers.ros.org/question/35183/compressed-image-to-image/

You would use this like:

rosrun image_transport republish compressed in:=/internet/image out:=/camera/image

Where the topic for your internet stream is:

/internet/image/compressed
edit flag offensive delete link more

Comments

Thank you @Chad Rockey . It was quite thoughtful of you to say that the internet stream image topic name. Very Useful!

sai gravatar image sai  ( 2018-05-09 03:33:42 -0600 )edit

Question Tools

Stats

Asked: 2013-01-04 08:15:50 -0600

Seen: 10,481 times

Last updated: Jan 05 '13