Phil
Phil

Reputation: 13

Creative Gesture Camera in Processing

I'm trying to use the creative gesture camera in Processing. I started with the Intel Perceptual Computing SDK, and ran into an issue.

I want to get the hand openness, and I am running into some issues - no matter what, the hand.openness returns 0. It otherwise runs quite well...

Some Sample code I'm trying to get to work: If you open your hand it starts printing to the console, close it and it stops.

import intel.pcsdk.*;

PXCUPipeline session;
PXCMGesture.GeoNode hand = new PXCMGesture.GeoNode();

void setup()
{
  session = new PXCUPipeline(this);
  if(!session.Init(PXCUPipeline.GESTURE))
    exit();
}

void draw()
{
  background(0);
  if(session.AcquireFrame(false))
  {
    if(session.QueryGeoNode(PXCMGesture.GeoNode.LABEL_BODY_HAND_PRIMARY|PXCMGesture.GeoNode.LABEL_OPEN, hand)) //Only when primary hand is open
    {
      rect(0, 0, 10, 10);
      println(hand.openness + " : " + frameCount); //Openness should be from 0 to 100
    }
    session.ReleaseFrame();
  }
}

Using the current version of Processing (2.0.3), Perceptual Computing SDK Version 7383.

Upvotes: 1

Views: 226

Answers (1)

Seth Gibson
Seth Gibson

Reputation: 16

Try updating the version of the SDK you're using if your project will allow it, there were quite a few bugs with getting attributes such as openess, openessState, radius, to name a few with the processing library (some attributes would even throw a null pointer exception when trying to retrieve them). I believe these have all been fixed in the recent versions, along with the inclusion of 64 bit processing support.

Upvotes: 0

Related Questions