voidUpdateUserMap()
{int numOfPoints = 0;
Array.Clear(usersHistogramMap,0, usersHistogramMap.Length);//Calculate cumulative histogram for depth 计算深度累积直方图
for (int i = 0; i < usersMapSize; i++)
{//Only calculate for depth that contains users 只计算深度,包含用户
if ((usersDepthMap[i] & 7) != 0)
{
usersHistogramMap[usersDepthMap[i]>> 3]++;
numOfPoints++;
}
}if (numOfPoints > 0)
{for (int i = 1; i < usersHistogramMap.Length; i++)
{
usersHistogramMap[i]+= usersHistogramMap[i - 1];
}for (int i = 0; i < usersHistogramMap.Length; i++)
{
usersHistogramMap[i]= 1.0f - (usersHistogramMap[i] /numOfPoints);
}
}//dummy structure needed by the coordinate mapper
KinectWrapper.NuiImageVi