0
$\begingroup$

Rosanswers logo

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!


Originally posted by pacifica on ROS Answers with karma: 136 on 2013-01-04

Post score: 1


Original comments

Comment by Eric Perko on 2013-01-04:
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?

Comment by pacifica on 2013-01-04:
I need to use image stream in ros. I hope to transform compressImage data in a CvMat :D or any opencv data format.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

SOLVED:

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

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


Originally posted by pacifica with karma: 136 on 2013-01-05

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by kabamaru on 2013-01-18:
what type is buffer_image_compressed? sensor_msgs::CompressedImage?

$\endgroup$
0
$\begingroup$

Rosanswers logo

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

Originally posted by Chad Rockey with karma: 4541 on 2013-01-05

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by sai on 2018-05-09:
Thank you @Chad Rockey . It was quite thoughtful of you to say that the internet stream image topic name. Very Useful!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.