private void KinectColorFrameReady(object sender, ColorImageFrameReadyEventArgs args) { if (!isTakingPhoto) { return; } using (ColorImageFrame colorFrame = args.OpenColorImageFrame()) { if (colorFrame == null) { return; } ColorImage img; if (activeSkeleton == null) { img = FramesReady.ColorFrameReady(colorFrame, _genderClassifier, areaOfInterest); TBPlayerStatus.Text = "Tracking Player: false"; } else { img = FramesReady.ColorFrameReady(colorFrame, _genderClassifier, areaOfInterest, sensor, activeSkeleton.Joints[JointType.Head]); TBPlayerStatus.Text = "Tracking Player: true"; } ExcelManager.instance.AddOrUpdate(DateTime.Now.GetDate(), ExcelRow.instance); #if SHOW_CAMERA GrayImage grayImg = img.Convert <Gray, byte>(); grayImg.Processing(); imgViewer.Image = img; #endif } isTakingPhoto = false; }
private void KinectDepthFrameReady(object sender, DepthImageFrameReadyEventArgs args) { using (DepthImageFrame depthFrame = args.OpenDepthImageFrame()) { if (depthFrame == null) { return; } FramesReady.DepthFrameReady(depthFrame, ref _interactionStream); } }