Question

I need a litle help here. I have a kinect working with processing using SimpleOpenNi library, and i just want the kinect send the position of a skeleton only 2 in 2 seconds for example. And if the position is the same as sent before don't do the action, is that possible? Thank You

Was it helpful?

Solution

Yes, you have to set a delay between a "send" and another.

In thread where you're reading values:

while(..) {
  Thread.sleep(2000); /* delay 2000ms => 2s */
  /* read value */
  /* if not the first iteration, save value in temp array */
  /* else check for each bone:  oldPos - epsilon < newPos < oldPos + epsilon */
}

To check if the previous positions is the same, you have to save skeleton positions in a temp var and check if new values is the same, maybe with a certaing neighborhood.

Unfortunately there is no other solution because on configuration file you can set only two kind of FPS (here there's a discussion about):

  • For color image
    FPS = 15 @ 1280x1024
    FPS = 30 @ 640x480

  • For depth FPS = 30 @ 640x480

In tag MapOutputMode of your configuration file:

<OpenNI>
  <Licenses>
    <License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4="/>
  </Licenses>
  <Log writeToConsole="false" writeToFile="false">
    <LogLevel value="3"/>
    <Masks>
      <Mask name="ALL" on="true"/>
    </Masks>
    <Dumps></Dumps>
  </Log>
  <ProductionNodes>
    <Node type="Depth" name="Depth1">
      <Configuration>
        <MapOutputMode xRes="640" yRes="480" FPS="30" />
        <Mirror on="false"/>
      </Configuration>
    </Node>
    <Node type="User"/>
    <Node type="Gesture"/>
    <Node type="Hands"/>
  </ProductionNodes>
</OpenNI>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top