image_saver and image_viewer have different images.
I was trying to use Gazebo inbuilt kinect camera to take depth image for robot. However, all the photos saved using image_saver are quite dim. However, if I try to view the depth image using rosrun image_viewer image_viewer. Everything looks ok. The photos are attached below. Can anyone explain why and how to fix it?
image_viewer
image_saver:(Very dark, but not completely black, you can see the shape of the robot from certain angle)
command: rosrun image_view image_saver image:=/camera/depth/image_raw_throttle _encoding:=16UC1 _filename_format:="image%04i.png"
This might be a problem of the image being float (range 0-1) or int (0-255). It looks like you have to convert the image from float to int to display it correctly. I am not sure though if this is the solution, just a guess.
The pixel ranges from 0 to 255. Below is some sample pixel value.\
(more)Could also be because your depth image is saved in 16 bit (16UC1), thus the range is 0-65535. This would explain why your image is very dark,since values like 207 or 90 are only 0.3 percent of the whole brightness range. You could try to normalize the image to the correct range to display it correctly