com.primesense.nite
Class UserMap

java.lang.Object
  extended by com.primesense.nite.UserMap

public class UserMap
extends java.lang.Object

This class stores the output from the UserTracker algorithm.

The basic purpose of the User Tracker algorithm is to analyze a depth frame and to locate all users in the scene, to indicate which pixels belong to which user, and which pixels belong to the background.

The output is in the form of a two dimensional array with the same dimensions as the depth frame that was used as the input to UserTracker. Each element of the array corresponds to a single pixel from the depth map, and indicates the UserID of the user which occupies that pixel.

The UserId value 0 is used to indicate pixels that contain no users (ie background).


Method Summary
 int getHeight()
          Gets the height of the UserMap array.
 java.nio.ByteBuffer getPixels()
          Returns a direct pointer to the array containing the UserMap data.
 int getStride()
          This function returns the stride of the array returned by getPixels.
 int getWidth()
          Gets the width of the UserMap array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPixels

public java.nio.ByteBuffer getPixels()
Returns a direct pointer to the array containing the UserMap data. This array has type UserID, and a size equal to y*stride. If your application needs to calculate the size value directly, then see getHeight() and getStride().

Returns:
Data array of pixels.

getWidth

public int getWidth()
Gets the width of the UserMap array. This value will match the X resolution of the depth map that was used to create the UserMap.

Returns:
Width of the UserMap, measured in pixels.

getHeight

public int getHeight()
Gets the height of the UserMap array. This value will match the Y resolution of the depth map that was used to create the UserMap. This value can be used, along with the value returned by getStride() to determine the size of the array in bytes.

Returns:
Height of the UserMap, measured in pixels.

getStride

public int getStride()
This function returns the stride of the array returned by getPixels. The stride of the array is defined as the width of a single row of that array, measured in bytes. This value can be multiplied by the value returned by getHeight() to calculate the size of the array.

Returns:
Stride of the array, measured in bytes.