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 imagesaver are quite dim. However, if I try to view the depth image using rosrun imageviewer 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 imageview imagesaver image:=/camera/depth/imagerawthrottle encoding:=16UC1 _filenameformat:="image%04i.png"
Asked by Chao Chen on 2020-08-26 16:53:38 UTC
Comments
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.
Asked by rfn123 on 2020-08-27 03:54:33 UTC
The pixel ranges from 0 to 255. Below is some sample pixel value.\
Asked by Chao Chen on 2020-08-28 01:00:53 UTC
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
Asked by rfn123 on 2020-08-28 10:18:20 UTC