OpenNi: save /came/depth/image_raw to PGM 11 bit? [closed]
Hi,
I need to save image from kinect topic /camera/depth/image_raw to PGM. I use cv_bridge 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?
This sounds more like an OpenCV question about file formats; maybe ask it over on the OpenCV answers site? http://answers.opencv.org/questions/
Thanks, I will try.
I have the same question. Do you know the answer now? Thanks.