Ejemplo n.º 1
0
    void Start()
    {
        KinectOneInput input = ((KinectOneInput)KinectOneInput.Instance);

        _mapper           = input.GetMapper();
        depthInfo         = input.GetDepthSensor();
        textureSize       = new ResolutionData(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height);
        texture           = new Texture2D(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height, TextureFormat.RGBA32, false);
        texture.wrapMode  = TextureWrapMode.Clamp;
        depthHistogramMap = new float[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        depthToColor      = new Color32[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        outputPixels      = new Color32[textureSize.Width * textureSize.Height];

        if (null != target)
        {
            target.material.mainTexture = texture;
        }
        m_engageuser = this.GetComponent <KinectOneEngageSingleUser>();
        CalImage2Screen(DepthImagePos.LeftMain);
    }
Ejemplo n.º 2
0
    void Start()
    {
        KinectOneInput input = ((KinectOneInput)KinectOneInput.Instance);
        _mapper = input.GetMapper();
        depthInfo = input.GetDepthSensor();
        textureSize = new ResolutionData(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height);
        texture = new Texture2D(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height,TextureFormat.RGBA32,false);
        texture.wrapMode = TextureWrapMode.Clamp;
        depthHistogramMap = new float[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        depthToColor = new Color32[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        outputPixels = new Color32[textureSize.Width * textureSize.Height];

        if (null != target)
        {
            target.material.mainTexture = texture;
        }
        m_engageuser = this.GetComponent<KinectOneEngageSingleUser>();
        CalImage2Screen(DepthImagePos.LeftMain);
    }