예제 #1
0
        public TrackingEngine(KinectData kinect, KinectHandler kinectHandler)
        {
            if (Log == null)
            {
                return;
            }
            Log.Info("Starting TrackingEngine");
            _kinect        = kinect;
            _kinectHandler = kinectHandler;
            Strategy       = RECOGNIZED_FIRST;
            if (_kinect != null)
            {
                Log.Info("Attaching to Kinect");
                var kinectSensor = _kinect.GetSensor();
                if (kinectSensor != null)
                {
                    kinectSensor.AllFramesReady += TrackingEngineAllFramesReady;
                }
                _recognitionEngine = new RecognitionEngine(kinect, this);
            }
            _activeTID = -1;
            Log.Info("Tracking Engine Started");

            LoadUsers();

            Log.Info("Users loaded");
        }
예제 #2
0
        public KinectHandler(KinectData kinect, Device comInterface)
        {
            if (Log == null)
            {
                return;
            }
            Log.Info("Initializing Framework");

            _comInterface = comInterface;
            _kinect       = kinect;

            if (_kinect != null && _kinect.GetSensor() == null)
            {
                Log.Error("Kinect not initialized, Cannot continue.");
                return;
            }

            _commands = FileLoader.LoadVoiceCommands();
            if (_commands == null)
            {
                return;
            }
            _vocCom = new VoiceCommander(_commands);
            _vocCom.OrderDetected += VoiceCommandDetected;
        }
예제 #3
0
 public RecognitionEngine(KinectData kinect, TrackingEngine trackingEngine)
 {
     _featureDetector = new BodyFeatureDetector();
     _recognizer      = new Recognizer();
     _kinect          = kinect;
     _trackingEngine  = trackingEngine;
     _recognizer.RecognitionCompletedEvent += _recognizer_RecognitionCompletedEvent;
     _recognizer.TrainingCompletedEvent    += _recognizer_TrainingCompletedEvent;
 }
예제 #4
0
 public RecognitionEngine(KinectData kinect, TrackingEngine trackingEngine)
 {
     _featureDetector = new BodyFeatureDetector();
     _recognizer = new Recognizer();
     _kinect = kinect;
     _trackingEngine = trackingEngine;
     _recognizer.RecognitionCompletedEvent += _recognizer_RecognitionCompletedEvent;
     _recognizer.TrainingCompletedEvent += _recognizer_TrainingCompletedEvent;
 }
예제 #5
0
 Boolean IDevice.Init()
 {
     LoadLogger();
     Log.Info("Starting Kinect automation environment...");
     _kinect   = new KinectData(0);
     _kHandler = new KinectHandler(_kinect, this);
     _kHandler.Init();
     if (_kinect.GetSensor() == null)
     {
         Log.Error("Kinect could not be instantiated. Terminating.");
         return(false);
     }
     return(true);
 }
예제 #6
0
        public GestureProcessor(IKinect kinectHandler, KinectData kinect)
        {
            _pointer = new ObjectPointer();
            Log.Debug("objectPointer loaded");
            _pointer.SetObjects(FileLoader.LoadObj("livingRoom.obj", FileLoader.Units.cm));

            Log.Debug("objects loaded");

            _kinectHandler = kinectHandler;
            _kinect = kinect;
            _seqCoords = new ArrayList();

            if (kinect != null) kinect.attachSkeletonHandler(SkeletonDataReadyHandler);

            _dtw = new DtwGestureRecognizer(12, 0.6, 2, 2, 10);
            Skeleton2DDataExtract.Skeleton2DdataCoordReady += NuiSkeleton2DdataCoordReady;
            _pointer.ContextSelected += PointerContextSelected;
        }
예제 #7
0
        public KinectHandler(KinectData kinect, Device comInterface)
        {
            if (Log == null) return;
            Log.Info("Initializing Framework");

            _comInterface = comInterface;
            _kinect = kinect;

            if(_kinect != null && _kinect.GetSensor() == null)
            {
                Log.Error("Kinect not initialized, Cannot continue.");
                return;
            }

            _commands = FileLoader.LoadVoiceCommands();
            if (_commands == null) return;
            _vocCom = new VoiceCommander(_commands);
            _vocCom.OrderDetected += VoiceCommandDetected;
        }
예제 #8
0
        public GestureProcessor(IKinect kinectHandler, KinectData kinect)
        {
            _pointer = new ObjectPointer();
            Log.Debug("objectPointer loaded");
            _pointer.SetObjects(FileLoader.LoadObj("livingRoom.obj", FileLoader.Units.cm));

            Log.Debug("objects loaded");

            _kinectHandler = kinectHandler;
            _kinect        = kinect;
            _seqCoords     = new ArrayList();

            if (kinect != null)
            {
                kinect.attachSkeletonHandler(SkeletonDataReadyHandler);
            }

            _dtw = new DtwGestureRecognizer(12, 0.6, 2, 2, 10);
            Skeleton2DDataExtract.Skeleton2DdataCoordReady += NuiSkeleton2DdataCoordReady;
            _pointer.ContextSelected += PointerContextSelected;
        }
예제 #9
0
        public TrackingEngine(KinectData kinect, KinectHandler kinectHandler)
        {
            if (Log == null) return;
            Log.Info("Starting TrackingEngine");
            _kinect = kinect;
            _kinectHandler = kinectHandler;
            Strategy = RECOGNIZED_FIRST;
            if (_kinect != null)
            {
                Log.Info("Attaching to Kinect");
                var kinectSensor = _kinect.GetSensor();
                if (kinectSensor != null)
                    kinectSensor.AllFramesReady+=TrackingEngineAllFramesReady;
                _recognitionEngine = new RecognitionEngine(kinect,this);
            }
            _activeTID = -1;
            Log.Info("Tracking Engine Started");

            LoadUsers();

            Log.Info("Users loaded");
        }
예제 #10
0
 Boolean IDevice.Init()
 {
     LoadLogger();
     Log.Info("Starting Kinect automation environment...");
     _kinect = new KinectData(0);
     _kHandler = new KinectHandler(_kinect, this);
     _kHandler.Init();
     if(_kinect.GetSensor() == null)
     {
         Log.Error("Kinect could not be instantiated. Terminating.");
         return false;
     }
     return true;
 }