[Resolved]Hand tracking with Kinect/Processing

edited December 2016 in Kinect


I am trying to make a project with Processing and the Kinect, I already installed the right library (I use OpenNI and FingerTracker), everything seems to work. I followed a tutorial, which showed how to make the kinect detect our hands, especially our fingers. It's this one :

import fingertracker.*;
import SimpleOpenNI.*;

FingerTracker fingers;
SimpleOpenNI kinect;
int threshold = 625;

void setup() {
  size(640, 480);

  kinect = new SimpleOpenNI(this);

  fingers = new FingerTracker(this, 640, 480);

void draw() {

  PImage depthImage = kinect.depthImage();
  image(depthImage, 0, 0);


  int[] depthMap = kinect.depthMap();

  for (int k = 0; k < fingers.getNumContours(); k++) {

  // iterate over all the fingers found
  // and draw them as a red circle
  for (int i = 0; i < fingers.getNumFingers(); i++) {
    PVector position = fingers.getFinger(i);
    ellipse(position.x - 5, position.y -5, 10, 10);

  text(threshold, 10, 20);

void keyPressed(){
  if(key == '-'){
    threshold -= 10;

  if(key == '='){
    threshold += 10;

Everything works great, but I'm trying to make it detect when my fingers are on a certain location of the window. I am creating a picture with Photoshop, which will be displayed on the screen in Processing, and I want the JPG to have locations in which several things happen when my fingers touch these spaces (for example some objects which appear suddenly, other windows opening...). Is it possible ? How can I make it ?

Thank you for your future answers.



  • (don't paste code as a quote, it looks a mess. instead highlight it and press ctrl-o)

  • It's done, sorry !

  • edited November 2016 Answer ✓

    Right now you are loading each finger location into PVector position and drawing it with position.x, position.y.

    It sounds like you want to ask if that position.x,y are in a location, then draw an image(). "In a location" might mean at some distance dist() from or between some known boundaries, i.e. collision detection: 1 2 3.

  • Could someone please share a download link or zip file of SimpleOpenNI. The one I have doesn't seem to work and finding the library download is now very difficult. I've gotten the Kinect to work with other libraries.

Sign In or Register to comment.