public void reset() { nodeX = -1; nodeY = -1; opennes = 0; alertLabel = PXCMGesture.Alert.Label.LABEL_ANY; gestureLabel = PXCMGesture.Gesture.Label.LABEL_ANY; }
public MyGestureParams() { nodeX = -1; nodeY = -1; opennes = 0; alertLabel = PXCMGesture.Alert.Label.LABEL_ANY; gestureLabel = PXCMGesture.Gesture.Label.LABEL_ANY; }
private void CheckFieldOfView(PXCMGesture.Alert.Label alert) { if (alert == PXCMGesture.Alert.Label.LABEL_GEONODE_ACTIVE) { _isHandActive = true; } else if (alert == PXCMGesture.Alert.Label.LABEL_GEONODE_INACTIVE || alert == PXCMGesture.Alert.Label.LABEL_FOV_BLOCKED) { _isHandActive = false; ClearHover(); HideHand(); } //if (_isHandActive) ShowHand(); //else HideHand(); }
public void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { bgwk1Running = true; GesturePipeline pipeline = new GesturePipeline(); PXCMGesture.Alert.Label alertLabel = PXCMGesture.Alert.Label.LABEL_ANY; MyGestureParams geoNodeParams = new MyGestureParams(); pipeline.Init(); if (MessageBox.Show("Initialise Voice pipeline?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { backgroundWorker1.ReportProgress(1); } while (true) { //check if need to terminate the pipline when window is closing if (backgroundWorker1.CancellationPending) { e.Cancel = true; break; } if (pipeline.AcquireFrame(true)) { if (pipeline.IsImageFrame()) { if (alertLabel != pipeline.geoNodeParams.alertLabel) { alertLabel = pipeline.geoNodeParams.alertLabel; } //check existance of geoNode if ((alertLabel != PXCMGesture.Alert.Label.LABEL_ANY) && (alertLabel != PXCMGesture.Alert.Label.LABEL_GEONODE_INACTIVE) && (alertLabel != PXCMGesture.Alert.Label.LABEL_FOV_BLOCKED)) { geoNodeParams = pipeline.geoNodeParams; alertLabel = geoNodeParams.alertLabel; backgroundWorker1.ReportProgress(3, geoNodeParams); } else { geoNodeParams.reset(); geoNodeParams.alertLabel = alertLabel; backgroundWorker1.ReportProgress(3, geoNodeParams); } } else { pipeline.ReleaseFrame(); continue; } if (!pipeline.ReleaseFrame()) { break; } } else { MessageBox.Show("Failed to initialize GesturePipeline"); break; } } pipeline.PauseGesture(true); //pipeline.ReleaseFrame(); pipeline.Close(); pipeline.Dispose(); bgwk1Running = false; //MessageBox.Show("stopping backgroundWorker1"); }