Ejemplo n.º 1
0
 void GetNoTrackingTexture(KinectOneDepth depth)
 {
     ushort[] data = depth.GetData();
     Debug.Log(outputPixels.Length);
     for (int i = 0; i < outputPixels.Length; i++)
     {
         int depthValue = Mathf.Clamp(data[i], 0, depthToColor.Length - 1);
         outputPixels[i] = depthToColor[depthValue];
     }
 }
Ejemplo n.º 2
0
 void GetNoTrackingTexture(KinectOneDepth depth)
 {
     ushort[] data = depth.GetData();
     Debug.Log(outputPixels.Length);
     for (int i = 0; i < outputPixels.Length; i++)
     {
         int depthValue = Mathf.Clamp(data[i], 0, depthToColor.Length - 1);
         outputPixels[i] = depthToColor[depthValue];
     }
 }
Ejemplo n.º 3
0
    void UpdateTexture(KinectOneDepth depth, KinectOneLabelMap labelmap, KinectOneImage image)
    {
        int trackedUserId = -1;

        if (m_engageuser != null && m_engageuser.engagedTrackedUser != null)
        {
            trackedUserId = m_engageuser.engagedTrackedUser.Id;
        }
        if (trackedUserId == -1)
        {
            GetNoTrackingTexture(depth);
        }
        else
        {
            Kinect.ColorSpacePoint[] colorSpacePoints = new Kinect.ColorSpacePoint[depth.xres * depth.yres];
            _mapper.MapDepthFrameToColorSpace(depth.GetData(), colorSpacePoints);
            GetRemoveBackground(labelmap, image, colorSpacePoints);
        }
        texture.SetPixels32(outputPixels);
        texture.Apply();
    }
Ejemplo n.º 4
0
 void UpdateTexture(KinectOneDepth depth, KinectOneLabelMap labelmap, KinectOneImage image)
 {
     int trackedUserId = -1;
     if (m_engageuser != null && m_engageuser.engagedTrackedUser != null)
         trackedUserId = m_engageuser.engagedTrackedUser.Id;
     if (trackedUserId == -1)
     {
         GetNoTrackingTexture(depth);
     }
     else
     {
         Kinect.ColorSpacePoint[] colorSpacePoints = new Kinect.ColorSpacePoint[depth.xres * depth.yres];
         _mapper.MapDepthFrameToColorSpace(depth.GetData(), colorSpacePoints);
         GetRemoveBackground(labelmap, image, colorSpacePoints);
     }
     texture.SetPixels32(outputPixels);
     texture.Apply();
 }