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

asked 2012-09-26 01:57:49 -0500

liborw gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason OpenCV Question: THe OpenCV community prefers to answer questions at: http://answers.opencv.org/questions/ by tfoote
close date 2015-06-30 19:01:24.449975

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/

ahendrix gravatar image ahendrix  ( 2012-09-26 12:36:13 -0500 )edit

Thanks, I will try.

liborw gravatar image liborw  ( 2012-10-10 02:03:41 -0500 )edit

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

DiogoCorrea gravatar image DiogoCorrea  ( 2012-12-10 09:56:15 -0500 )edit