Robotics StackExchange | Archived questions

OpenNi: save /came/depth/image_raw to PGM 11 bit?

Hi,

I need to save image from kinect topic /camera/depth/imageraw to PGM. I use cvbridge to convert the message to OpenCV image. However, if I try to show or save the image I see just black screen. This is because the PGM file is saved as 16 bit but the kinect data are just 11 bit. So the PGM header is "P5 640 480 65535" but I need "P5 640 480 2048". If I change it manually the image is displayed fine, but I need this to be done automatically?

Asked by liborw on 2012-09-26 01:57:49 UTC

Comments

This sounds more like an OpenCV question about file formats; maybe ask it over on the OpenCV answers site? http://answers.opencv.org/questions/

Asked by ahendrix on 2012-09-26 12:36:13 UTC

Thanks, I will try.

Asked by liborw on 2012-10-10 02:03:41 UTC

I have the same question. Do you know the answer now? Thanks.

Asked by DiogoCorrea on 2012-12-10 10:56:15 UTC

Answers