# 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:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luonglinhle](https://avatars.discourse-cdn.com/v4/letter/l/f0a364/32.png) [@luonglinhle](https://discourse.processing.org/u/luonglinhle)\
**Post date:** [October 16, 2019, 11:46am UTC](https://discourse.processing.org/t/kinect-getting-raw-data-and-value/14737/1 "2019-10-16T11:46:20Z")

</div>

Hello!

I am a newbie. I was wondering if anyone know how to get raw values that measure distance in Kinect V1 and V2? I am also working via MacBook so I wonder if it makes much different in processing program.  
My purpose is to transport this data to Touchdesigner and work from the scratch.

Please help me, I would appreciate a lot! Thank you.

---

<div class="post-metadata">

**Author:** ![zly1994411](https://avatars.discourse-cdn.com/v4/letter/z/c68b51/32.png) [@zly1994411](https://discourse.processing.org/u/zly1994411)\
**Post date:** [October 17, 2019, 8:15pm UTC](https://discourse.processing.org/t/kinect-getting-raw-data-and-value/14737/2 "2019-10-17T20:15:05Z")

</div>

Check out Daniel Shiffman in Youtube.

---

<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)
