public bool Init() { //Stop everything Stop(); //init the kinect _kinectController = new KinectController(); try { if (!_kinectController.Init()) return false; _kinectController.OnDepthFrame += new KinectController.DepthFrameHandler(_kinectController_OnDepthFrame); _kinectController.OnVideoFrame += new KinectController.VideoFrameHandler(_kinectController_OnVideoFrame); } catch (Exception) { return false; } //init settings int width = 0; int height = 0; SettingsManager.KinectSet.GetDepthResolution(out width, out height); //init the other classes PositionMapper.AssignKinectController(_kinectController); _rthread = new RecognitionThread(); _rthread.OnRecognitionFinished += new RecognitionThread.RecognitionFinished(_rthread_OnRecognitionFinished); Forms = new FormSupplier(this); _lastReconPacket = new RecognitionDataPacket(); //Everything worked, return true return true; }
public void Stop() { if (Forms != null) Forms.CloseAllForms(); if (_kinectController != null) { _kinectController.Stop(); _kinectController = null; } }
public static void AssignKinectController(KinectController kinect) { _kinectController = kinect; }