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

Revision history [back]

The two depth images in the top sequence in your post look different because of the different ways they're being shown on the screen, the underlying data is the same. Depth images are single channel floating point images where the pixel value is the distance from the camera in meters and zeros are used to represent unknown pixels. When you use cv::imshow with a floating point image it expects values between zero and one, so all values larger than one will be white and all values less than zero will be black. This is why your centre image is black and white. However rviz normalizes the image before it's shown so you can see the full depth range there. To get the same result with cv::imshow use the normalize function first to scale the dynamic range to the range 0-1.

I can't tell you why the two bag files are producing different results without some more information, did you capture then yourself or are they downloaded from the Internet?

Hope this helps.