# Kinect v2 library and find Users

**URL:** <https://discourse.processing.org/t/kinect-v2-library-and-find-users/37994>\
**Category:** Libraries\
**Created:** [July 16, 2022, 9:50pm UTC](https://discourse.processing.org/t/kinect-v2-library-and-find-users/37994 "2022-07-16T21:50:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![potter3366](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@potter3366](https://discourse.processing.org/u/potter3366)\
**Post date:** [July 16, 2022, 9:50pm UTC](https://discourse.processing.org/t/kinect-v2-library-and-find-users/37994/1 "2022-07-16T21:50:00Z")

</div>

When I run the app, the user is immediately detected. When he leaves the Kinect sensor field, the app still shows foundUsers = true and kinect.getNumOfUsers()=1. The number of users entering the Kinect field of view does not correspond to the real condition. What I have to do, reset kinect in draw function or is there another solution?

```auto
import KinectPV2.*;

KinectPV2 kinect;

boolean foundUsers = false;

void setup() {
  size(1024, 424);

  kinect = new KinectPV2(this);

  kinect.enableDepthImg(true);
  kinect.enableBodyTrackImg(true);

  kinect.init();
}

void draw() {
  background(0);

  image(kinect.getBodyTrackImage(), 0, 0);
  image(kinect.getDepthImage(), 512, 0);

  //raw body data 0-6 users 255 nothing
  int [] rawData = kinect.getRawBodyTrack();

  foundUsers = false;
  //iterate through 1/5th of the data
  for (int i = 0; i < rawData.length; i+=5) {
    if (rawData[i] != 255) {
      //found something
      foundUsers = true;
      break;
    }
  }

  fill(0);
  textSize(16);
  text(kinect.getNumOfUsers(), 50, 50);
  text("Found User: "+foundUsers, 50, 70);
  text(frameRate, 50, 90);
}

```
