public Form1(PXCMSession session) { InitializeComponent(); //_timer = null; thread = new MyBeautifulThread(DoRecognition); flagThread = 0; LightState = 0; flagLight = 0; WindState = 0; flagWind = 0; SendState = 0; sm = PXCMSenseManager.CreateInstance(); sm.EnableHand(); PXCMHandModule hand = sm.QueryHand(); sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 320, 240, 60); PXCMSenseManager.Handler handler = new PXCMSenseManager.Handler { onModuleProcessedFrame = OnModuleProcessedFrame }; sm.Init(handler); PXCMHandConfiguration handConfiguration = sm.QueryHand().CreateActiveConfiguration(); handConfiguration.EnableGesture("wave"); handConfiguration.EnableGesture("swipe_up"); handConfiguration.EnableGesture("thumb_up"); handConfiguration.EnableGesture("tap"); handConfiguration.ApplyChanges(); if (handConfiguration == null) { Console.WriteLine("Failed Create Configuration"); Console.WriteLine("That`s all..."); Console.ReadKey(); } logTextBox.Text = DateTime.Now.ToString("hh:mm:ss") + " Started" + "\n" + logTextBox.Text; }
public Form1() { InitializeComponent(); vol = new float[6] { 1F, 1F, 0F, 1F, 0.5F, 0F }; textVolume.Text = vol[3].ToString(); textSpeed.Text = vol[0].ToString(); textPanorama.Text = vol[4].ToString(); thread = new MyBeautifulThread(DoRecognition); flag = 0; sm = PXCMSenseManager.CreateInstance(); sm.EnableHand(); PXCMHandModule hand = sm.QueryHand(); PXCMSenseManager.Handler handler = new PXCMSenseManager.Handler { onModuleProcessedFrame = OnModuleProcessedFrame }; sm.Init(handler); PXCMHandConfiguration handConfiguration = sm.QueryHand().CreateActiveConfiguration(); handConfiguration.EnableGesture("thumb_down"); handConfiguration.EnableGesture("thumb_up"); handConfiguration.EnableGesture("v_sign"); handConfiguration.EnableGesture("spreadfingers"); handConfiguration.EnableGesture("fist"); handConfiguration.EnableGesture("full_pinch"); handConfiguration.ApplyChanges(); if (handConfiguration == null) { Console.WriteLine("Failed Create Configuration"); Console.WriteLine("That`s all..."); Console.ReadKey(); } logTextBox.Text = DateTime.Now.ToString("hh:mm:ss") + " Started" + "\n" + logTextBox.Text; }