# Kinect SimpleOpenNI Delay on lost user

**URL:** <https://discourse.processing.org/t/kinect-simpleopenni-delay-on-lost-user/13166>\
**Category:** Libraries\
**Created:** [August 4, 2019, 3:51am UTC](https://discourse.processing.org/t/kinect-simpleopenni-delay-on-lost-user/13166 "2019-08-04T03:51:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![QueenBee](https://avatars.discourse-cdn.com/v4/letter/q/a9adbd/32.png) [@QueenBee](https://discourse.processing.org/u/QueenBee)\
**Post date:** [August 4, 2019, 3:51am UTC](https://discourse.processing.org/t/kinect-simpleopenni-delay-on-lost-user/13166/1 "2019-08-04T03:51:35Z")

</div>

I’m trying to make a program which counts the number of users the Kinect sees, and displays a particular image depending on that number.

```auto
if (userCount == 0){
     println("No Users!");

  } else if (userCount == 1){
    image(Frame_4, 0, 0, width, height);
    println("One User!");

  } else if (userCount == 2){
    image(Frame_5, 0, 0, width, height);
    println("Two Users!");

  } 

```

It’s working which is epic - But I’ve just noticed there is a considerable delay (up to about 10 seconds) between a user exiting the Kinect’s area of vision, and the sketch realising this.

These are the SimpleOpenNI events; though I’m not sure how they work yet or if they contribute to this at all. I believe this delay is a hidden function in the library

```auto
void onNewUser(SimpleOpenNI curKinect, int userId)
{
  println("onNewUser - userId: " + userId);
  println("\tstart tracking skeleton");
  
  curKinect.startTrackingSkeleton(userId);
}

void onLostUser(SimpleOpenNI curKinect, int userId)
{
  println("onLostUser - userId: " + userId);
}

void onVisibleUser(SimpleOpenNI curKinect, int userId)
{
  println("onVisibleUser - userId: " + userId);
}

```

I have posted this on the SimpleOpenNI git, but replies tend to take a while over there and I’m really hoping to get this as smooth as I can by next week!

Any ideas on how to make this delay significantly less? It kind of ruins the flow of the interaction!

---

<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:** [August 8, 2019, 6:03pm UTC](https://discourse.processing.org/t/kinect-simpleopenni-delay-on-lost-user/13166/2 "2019-08-08T18:03:11Z")

</div>

Possibly relevant:

- [https://github.com/wexstorm/simple-openni/issues/4#issuecomment-198245017](https://github.com/wexstorm/simple-openni/issues/4#issuecomment-198245017)
- [https://github.com/wexstorm/simple-openni/issues/6](https://github.com/wexstorm/simple-openni/issues/6)

however, when searching for ServerNoClientsTimeout

[https://www.google.com/search?q=simpleopenni+ServerNoClientsTimeout](https://www.google.com/search?q=simpleopenni+ServerNoClientsTimeout)

… this might not be an option

- [https://forum.processing.org/two/discussion/2854/force-onlostuser-to-quit-faster-with-onvisibleuser](https://forum.processing.org/two/discussion/2854/force-onlostuser-to-quit-faster-with-onvisibleuser)

I think the key thing is that this is a Kinect configuration – if it is possible.
