private void writeText(BodyTracker.BodyStatus body_status) { string text = ""; double info; switch (body_status) { case (BodyTracker.BodyStatus.NONE): text = (string)Application.Current.FindResource("NO_BODY_FOUND"); break; case (BodyTracker.BodyStatus.TOO_CLOSE): info = bodyTracker.getDistanceToMove(); text = (string)Application.Current.FindResource("MOVE_AWAY") + "\n" + info + " metres"; break; case (BodyTracker.BodyStatus.TOO_FAR): info = bodyTracker.getDistanceToMove(); text = (string)Application.Current.FindResource("MOVE_CLOSER") + "\n" + info + " metres"; break; case (BodyTracker.BodyStatus.WRONG_POSE): text = (string)Application.Current.FindResource("BODY_NOT_ALIGNED_HELP"); break; case (BodyTracker.BodyStatus.CORRECT): text = (string)Application.Current.FindResource("BODY_SCANNING_HELP"); break; } this.help_text.Text = text; }
// Called when all farmes are available from the sensor void sensor_AllFrameCallback(BodyFrame bf, BodyIndexFrame bif, DepthFrame df) { if (sensor == null) { return; } if (bodyTracker.CorrectPose(bf)) { currentState = State.SCANNING; } else { currentState = State.NOT_ALIGNED; } BodyTracker.BodyStatus body_status = bodyTracker.getStatus(); writeText(body_status); updateDisplayedBitmap(bif); updateControls(currentState); if (captureFrame == true) // if countdown finished and capture of frame is requested { capturePointCloud(df, bif); captureFrame = false; // Reset Tag } }