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

Black image for an Image publisher with image_transport

asked 2015-01-04 14:45:15 -0600

Alexandre.Willame gravatar image

updated 2015-01-04 16:01:22 -0600

I made a node retrieving an image with openCV explained on this ROS tutorial. The image is ten converted into a format suitable for ROS, using CV_bridge functions.

Problem is, there is no image that are published at all on the \camera topic. I tried visualizing it using

rosrun image_view image_view

But the only thing that appear is a black image. I also tried using rviz camera, but nothing appears; rviz indicate that no image is received:

image description

Here is the code of the publisher:


And here is the CMakeLists.txt file:

image description

I made a standalone version of the code for openCV, and it display image correctly using imshow. I do believe that the problems lies in the conversion of the openCV image to the format required by the ROS nodes, but I do not know where to look to solve such problem.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-05 01:17:10 -0600

Wolf gravatar image

The source code takes a sample image as argv[1]. I. e. in a folder where a image file like my_photo.jpg is located you have to run it like

rosrun image_transport_tutorial my_publisher my_photo.jpg

in order for telling it what to publish; otherwise it will just publish an empty image header...

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-01-04 14:45:15 -0600

Seen: 799 times

Last updated: Jan 05 '15