kinect raw depth values

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

kinect raw depth values

engineer engineering
Hi -
 
can we obtain raw depth values through kinect driver utilizing the camera interface and  player_camera_data structure or map to raw depth values ;.
currently values appearto be in between 0 and 255 for publishing MONO16 depth values and libfreenect provides values between 0 and 2047 ie 11 bit raw represented by unsigned short which is 16 bit 
 
thanking you
 

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|

Re: kinect raw depth values

Rich Mattes-2
On 04/11/2013 11:53 AM, engineer engineering wrote:
> Hi -
> can we obtain raw depth values through kinect driver utilizing the
> camera interface and  player_camera_data structure or map to raw depth
> values ;.
> currently values appearto be in between 0 and 255 for publishing
> MONO16 depth values and libfreenect provides values between 0 and 2047
> ie 11 bit raw represented by unsigned short which is 16 bit
> thanking you
>

Are you sure that you're setting "downsample" to zero?  The code is
setting the image grab mode to 11 bit and copies the entire depth image
buffer into the buffer that gets published by Player.  I'll dig out my
Kinect over the weekend and verify that all 11 bits are coming across.

Rich

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Uli
Reply | Threaded
Open this post in threaded view
|

Re: kinect raw depth values

Uli
In reply to this post by engineer engineering
Have you already accessed the raw depth values? I tried to use Mono16 and to access the image data using "camera-> image" I got values like this (a high value followed by a low value):
156
3
156
3
156
3
156
3
156
3
255
7
255
7
255
7
255
7
255
7
255
7
255
7
255
7
I think the reason for the wrong values, is the fact that the camera interface only supports uint8_t * image (so the values are automatically destroyed).

I also can't use Mono8. Because the downsampling leads to a wrong point cloud representation of the floor (values are "downsampled" from a range between 0 and 2047 to a range between 0 to 255). I guess that the layers in the picture below appear due to downsampling. The picture shows a floor represented by a point cloud which is obtained by values of the Mono8 image format:


Can anybody help me? How can I access the raw depth values? Or in which way I have to modify the driver and/ or the camera interface?
Reply | Threaded
Open this post in threaded view
|

Re: kinect raw depth values

Rich Mattes-2



On Thu, Nov 14, 2013 at 7:20 AM, Uli <[hidden email]> wrote:
Have you already accessed the raw depth values? I tried to use Mono16 and to
access the image data using "camera-> image" I got values like this (a high
value followed by a low value):
156
3
156
3
156
3
156
3
156
3
255
7
255
7
255
7
255
7
255
7
255
7
255
7
255
7
I think the reason for the wrong values, is the fact that the camera
interface only supports uint8_t * image (so the values are automatically
destroyed).

I also can't use Mono8. Because the downsampling leads to a wrong point
cloud representation of the floor (values are "downsampled" from a range
between 0 and 2047 to a range between 0 to 255). I guess that the layers in
the picture below appear due to downsampling. The picture shows a floor
represented by a point cloud which is obtained by values of the Mono8 image
format:
<http://player-stage-gazebo.10965.n7.nabble.com/file/n19160/FloorCloud.png>

Can anybody help me? How can I access the raw depth values? Or in which way
I have to modify the driver and/ or the camera interface?

The uint16 values are packed into the uint8 array that the camera interface provides.  You need to either cast the data to uint16*, or copy the memory into a uint16 array.

The depth image is 11 bits (0-2047), you can see from the data above that there are bytes with 8 bits of precision (0-255) followed by bytes with 3 bytes of precision (0-7).  Once recombined to uint16 they'll provide the full 11 bit range.

Rich

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Uli
Reply | Threaded
Open this post in threaded view
|

Re: kinect raw depth values

Uli
Can I apply the following formula to combine two unit8 values in order to convert them to a single unit16 value?

camera_depth->image[i]+256*(camera_depth->image[i+1])

The values seem to be correct.:)
Uli
Reply | Threaded
Open this post in threaded view
|

Re: kinect raw depth values

Uli
Using the raw depth values also fixed the floor problem!!!