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

Converting a Compressed Image to QImage

asked 2015-03-25 10:03:15 -0600

David L-B gravatar image

Hi all,

I need to create a camera feed viewer that will need to run on very limited bandwidth networks. As such I want to use Compressed images instead of the raw image.

My application is python and uses PyQt for the gui.

How can I convert the /sensor_msgs/Compressed message to a QtGui.Qimage ?

Thanks

David

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-04-14 08:32:11 -0600

David L-B gravatar image

Found it myself:

qimage = QtGui.QImage.fromData(compressedImage.data)
imageMain = QtGui.QPixmap.fromImage(qimage)
self.ui.label1.setPixmap(imageMain)
edit flag offensive delete link more

Comments

1

from PyQt4 import QtGui

peci1 gravatar image peci1  ( 2015-09-14 20:50:10 -0600 )edit

Can you elaborate how to give input to compressedIamge.data using publisher/subscriber ?

beingtrippy gravatar image beingtrippy  ( 2020-08-15 00:07:15 -0600 )edit

Have a look at ImageTransport::Publisher: http://wiki.ros.org/image_transport/T... .

peci1 gravatar image peci1  ( 2020-08-17 09:18:33 -0600 )edit

Question Tools

Stats

Asked: 2015-03-25 10:03:15 -0600

Seen: 1,770 times

Last updated: Apr 14 '15