FREENECT_DEPTH_Rector does not affect libfreenect

I play with Kinect (the original version of Xbox) on the libfreenect driver (by the way, I'm on Ubuntu 12.04). I cloned the latest version from git and installed it manually according to the instructions here: http://openkinect.org/wiki/Getting_Started#Ubuntu_Manual_Install

I would like to access the recorded depths. As far as I understand, Kinect is calibrated by the factory, and the corresponding pixels of depth of correspondence correspond to the corresponding pixels of RGB.

I can open Kinect just fine and get raw data with a depth of 11 bits. This gives me values ​​that lie nonlinearly from about 730 to 1045 for distances from 1 to 7.5 meters.

Launch device->setDepthFormat(FREENECT_DEPTH_MM); makes Kinect output distances in mm, so setDepthFormat seems to work.

Launch device->setDepthFormat(FREENECT_DEPTH_REGISTERED); seems inefficient because only the original depths are displayed. What am I missing?

+4
source share
1 answer

Both FREENECT_DEPTH_MM and FREENECT_DEPTH_REGISTERED should return depth in mm. The difference is that the latter is aligned with the RGB video image.

The freenect_depth_format variable in libfreenect.h provides the following parameters:

 FREENECT_DEPTH_11BIT = 0, /**< 11 bit depth information in one uint16_t/pixel */ FREENECT_DEPTH_10BIT = 1, /**< 10 bit depth information in one uint16_t/pixel */ FREENECT_DEPTH_11BIT_PACKED = 2, /**< 11 bit packed depth information */ FREENECT_DEPTH_10BIT_PACKED = 3, /**< 10 bit packed depth information */ FREENECT_DEPTH_REGISTERED = 4, /**< processed depth data in mm, aligned to 640x480 RGB */ FREENECT_DEPTH_MM = 5, /**< depth to each pixel in mm, but left unaligned to RGB image */ FREENECT_DEPTH_DUMMY = 2147483647, /**< Dummy value to force enum to be 32 bits wide */ 

Source: libfrenect git problems page

The registration conversion creates an image of depth, as if the RGB and IR cameras were physically located in the same place, and not offset 2.5 cm. If you are interested in the details, take a look at the source code.

Source: libfreenect source code

+2
source

Source: https://habr.com/ru/post/1438886/


All Articles