Rosanswers logo


I'm following the cv_bridge tutorial

The code is correct(I just copy the code and change the topic name to mine /camera/image ), also modified the CMakeLists.xml.

The catkin_build is successful without error.

But when I run the node, there is nothing showed up.

The node should run up successfully because new topics show up.


Also I can view the image using image_view

rosrun image_view image_view image:=/camera/image _image_transport:=compressed

I'm afraid maybe the compressed video matters so I change add the command when running:

$ rosparam set /compressed_listener/image_transport compressed
$ rosrun mypackage mynode __name:=compressed_listener


But still no display window...


[Originally posted](https://answers.ros.org/question/171726/no-image-display-window-in-cv_bridge-tutorial.-(does-compressed-image-matter?/) by lanyusea on ROS Answers with karma: 279 on 2014-05-29

Post score: 0

Original comments

Comment by ahendrix on 2014-05-30:
Are any images published on the /image_converter/output_video topic? You should be able to verify that images are being published with

rostopic hz
rostopic echo

Comment by lanyusea on 2014-05-30:
@ahendrix nothing... I ran rostopic echo /image_converter/output_video but got nothing. I think the subscribe of video topic failed.

Comment by lanyusea on 2014-05-30:
I guess maybe the image_transport matters because when I subscribe I just use the code image_sub_ = it_.subscribe("/camera/image", 1, &ImageConverter::imageCb, this); while for image_view, I need to set _image_transport=compressed to see the video. But I don't know what to change here...

Comment by lanyusea on 2014-05-31:
@ahendrix Thanks so much! it works, but could you teach me how to find the parameter need to remap? first I searched the source and wiki of image_transport and cv_bridge with key workcompressed, but I got nothing... I really want to know how to get the answer when I face that kind of problem

Comment by ahendrix on 2014-06-02:
to be honest, I'm not sure what the appropriate parameter to change here is. I suspect it's namespaced to the topic name, but I'd have to read the source for image_transport to really understand it.

Comment by lanyusea on 2014-06-03:
@ahendrix Thanks again, I read the document again and now I can understand it much better. Also, could you convert it into the answer so I can mark it as the correct one.


1 Answer 1


Rosanswers logo

Try constructing your listener with the extra argument specifying the transport hint:

image_sub_ = it_.subscribe("/camera/image", 1, &ImageConverter::imageCb, this, image_transport::TransportHints("compressed"));

Originally posted by ahendrix with karma: 47576 on 2014-05-30

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

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