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

Revision history [back]

Hi There,

The problem here is that the encoding you are setting doesn't actually control the image content it only describes what's there. In the case of your first image it is being stored in 8 bit BGR encoding so with that specified it looks as it should.

In the case of the second image you've set the encoding to Mono 8 but the data of the image hasn't changed, as a result we are only seeing the leftmost third of the image. In this image each horizontal group of 3 grey pixels intensities are representing the blue, green and red components of the original image.

It's possible that the camera node you're using cannot produce grey scale images directly. In that case you can make a simple node that receives color images converts them to grey scale using OpenCV and publishes them again.

I have worked with wide and fish-eye lenses quite a bit in ROS, I use the OpenCV fish-eye functions directly.

Hope this helps.