//Prepare to draw point cloud.
    private void InitValues()
    {
        depthWidth  = kinectSensor.GetCalibration().DepthCameraCalibration.ResolutionWidth;
        depthHeight = kinectSensor.GetCalibration().DepthCameraCalibration.ResolutionHeight;

        vertices = new byte[depthWidth * depthHeight * 3 * 2]; // short3 = 3 * 2byte
        colors   = new byte[depthWidth * depthHeight * 4];

        xyzImage = new Image(ImageFormat.Custom, depthWidth, depthHeight, 6 * depthWidth);

        done = false;
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Function handling the events raised by the KinectSensor when a new capture is available
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="captureArg"> Object containing the new capture</param>
 private void HandleCapture(object sender, CaptureEventArgs captureArg)
 {
     if (kinectCapture == null)
     {
         kinectCapture = new Kinect4AFrameCapture(kinectSensor.GetCalibration(), kinectSensor.ImageFormat);
     }
     kinectCapture.SetCapture(captureArg.Capture);
 }
Ejemplo n.º 3
0
    /// <summary>
    /// Function handling the events raised by the KinectSensor when a new capture is available
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="captureArg"> Object containing the new capture</param>
    private void KinectSensor_CaptureReady(object sender, CaptureEventArgs e)
    {
        if (!IsInitializationComplete)
        {
            var calibration           = kinectSensor.GetCalibration();
            TrackerConfiguration conf = TrackerConfiguration.Default;
            conf.ProcessingMode      = processingMode;
            conf.ModelPath           = modelPath;
            tracker                  = new Tracker(in calibration, conf);
            IsInitializationComplete = true;
        }

        if (IsInitializationComplete && IsAvailable)
        {
            tracker.TryEnqueueCapture(e.Capture);
        }
    }