void kinectRuntime_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e) { if (replay != null && !replay.IsFinished) { return; } using (var frame = e.OpenColorImageFrame()) { if (frame == null) { return; } if (recorder != null && ((recorder.Options & KinectRecordOptions.Color) != 0)) { recorder.Record(frame); Debug.WriteLine("Color Recorded"); } // if (displayDepth) // return; colorManager.Update(frame); } }
void kinectSensor_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e) { if (replay != null && !replay.IsFinished) { return; } using (var frame = e.OpenDepthImageFrame()) { if (frame == null) { return; } if (recorder != null && ((recorder.Options & KinectRecordOptions.Depth) != 0)) { recorder.Record(frame); } if (!displayDepth) { return; } depthManager.Update(frame); } }
private void OnAllFramesReady(object sender, AllFramesReadyEventArgs e) { if (Recording) { using (SkeletonFrame SkeletonFrame = e.OpenSkeletonFrame()) { if (SkeletonFrame != null) { KinectSkeletonRecorder.Record(SkeletonFrame); } } using (ColorImageFrame ColorImageFrame = e.OpenColorImageFrame()) { if (ColorImageFrame != null) { KinectColorRecorder.Record(ColorImageFrame); } } using (DepthImageFrame DepthImageFrame = e.OpenDepthImageFrame()) { if (DepthImageFrame != null) { KinectDepthRecorder.Record(DepthImageFrame); } } } }
public void Record(SkeletonFrame frame) { if (null != KinectRecorder && KinectRecorder.IsRecording) { KinectRecorder.Record(frame); } }
public void Record(DepthImageFrame frame) { if (null != KinectRecorder && KinectRecorder.IsRecording) { KinectRecorder.Record(frame); } }
void KinectSensorAllFramesReady(object sender, AllFramesReadyEventArgs e) { if (replay != null && !replay.IsFinished) { return; } using (var frame = e.OpenColorImageFrame()) { if (frame != null) { if (recorder != null) { recorder.Record(frame); } UpdateColorFrame(frame); } } using (var frame = e.OpenDepthImageFrame()) { if (frame != null) { if (recorder != null) { recorder.Record(frame); } } } using (var frame = e.OpenSkeletonFrame()) { if (frame != null) { if (recorder != null) { recorder.Record(frame); } UpdateSkeletons(frame); } } }
void KinectRuntimeColorFrameReady(object sender, ColorImageFrameReadyEventArgs e) { if (replay != null && !replay.IsFinished) { return; } using (var frame = e.OpenColorImageFrame()) { if (frame == null) { return; } if (recorder != null && ((recorder.Options & KinectRecordOptions.Color) != 0)) { recorder.Record(frame); } colorManager.Update(frame); } }
void kinectRuntime_AllFrameReady(object sender, AllFramesReadyEventArgs e) { // If replaying, bypass this. if (replay != null && !replay.IsFinished) { return; } using (var cf = e.OpenColorImageFrame()) using (var df = e.OpenDepthImageFrame()) using (var sf = e.OpenSkeletonFrame()) { try { if (recorder != null && sf != null && df != null && cf != null) { recorder.Record(sf, df, cf); } } catch (ObjectDisposedException) { } if (cf != null) { colorManager.Update(cf, !displayDebug); } if (df != null) { depthFrameNumber = df.FrameNumber; depthManager.Update(df); } if (sf != null) { UpdateSkeletonDisplay(sf); if (handTracker != null && recogEngine != null) { var result = handTracker.Update(depthManager.PixelData, colorManager.PixelData, SkeletonUtil.FirstTrackedSkeleton(sf.GetSkeletons())); var gesture = recogEngine.Update(result); lock (inputServer) inputServer.Send(gesture); UpdateDisplay(result); textGestureEvent.Text = gesture; fpsCounter.LogFPS(); } } } }