# Kinect getting raw data and value

**URL:** <https://discourse.processing.org/t/kinect-getting-raw-data-and-value/14737>\
**Category:** Libraries\
**Created:** [October 16, 2019, 11:46am UTC](https://discourse.processing.org/t/kinect-getting-raw-data-and-value/14737 "2019-10-16T11:46:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 20, 2019, 6:52pm UTC](https://discourse.processing.org/t/kinect-getting-raw-data-and-value/14737/3 "2019-10-20T18:52:45Z")

</div>

If you have a Kinect2, then you can use the library

```auto
import org.openkinect.freenect.*;
import org.openkinect.freenect2.*;
import org.openkinect.processing.*;
import org.openkinect.tests.*;

Kinect2 kinect2;

```

and then get the raw depth as a list of ints:

```auto
int[] rawDepth = kinect2.getRawDepth();

```

They can be accessed like a pixels[] array, using x, y:

```auto
int val = rawDepth[y * kinect.depthWidth + x]

```

For a recent related discussion, see:

- [Resizing Kinect depth image for use as 'reveal mask'](https://discourse.processing.org/t/resizing-kinect-depth-image-for-use-as-reveal-mask/14764)

---

_[View the full topic](https://discourse.processing.org/t/kinect-getting-raw-data-and-value/14737)._
