Player index with depth data
So far, we have seen how to work with the raw depth data from the sensor and manipulate the data based on the distance. In this section you will learn how Kinect returns the player information and how to deal with the player who is standing in front of the Kinect sensor.
While we were discussing depth data and distance, you have seen that for a 16-bit raw depth data, the first three bits represent the player index and the higher 13 bits represent the distance. You have already learned how the distance calculation works with those higher 13 bits; let's have a look at how those first three bits represent a player.
Note
Player tracking requires the skeleton stream to be enabled. If you have enabled only the depth stream, the sensor won't be able to return the player information. The sensor returns the player index values within the depth pixel bits only if the skeleton stream is enabled. We will discuss skeleton tracking in the upcoming chapters.