예제 #1
0
        private void Classify()
        {
            if (this.classifier == null || this.classifier.HasUpdates /* update flag */)
            {
                this.classifier                   = new GestureClassifier();
                this.classifier.ProblemFile       = this.featureFilePath;
                this.classifier.ModelFile         = this.modelFilePath;
                this.classifier.CategoryDetected += classifier_CategoryDetected;
                GestureStudio.DisplayLoadingWindow("Loading Image Classifier...");
                this.classifier.BeginInitialize(() =>
                {
                    GestureStudio.HideLoadingWindow();
                });
            }

            if (this.classifier.Initialized)
            {
                this.UpdateStatus("Classifying");
                this.classifier.ClassifyImage(this.croppedFrame);
            }
            else
            {
                this.UpdateStatus("Loading Classifier...");
            }
        }
예제 #2
0
        public void Stop()
        {
            this.mode = ProgramMode.Idle;
            this.UpdateStatus("Ready");

            // reset classifier/trainer
            this.classifier = null;
            this.trainer    = null;
        }
예제 #3
0
        public void BeginInitialize()
        {
            this.floodFill       = new FloodFill();
            this.mode            = ProgramMode.Idle;
            this.classifier      = null;
            this.trainer         = null;
            this.featureFilePath = null;
            this.modelFilePath   = null;

            GestureStudio.DisplayLoadingWindow("Loading Kinect Sensor...");
            ThreadPool.QueueUserWorkItem((state) =>
            {
                // init kinect
                this.StartKinectSensor();
                GestureStudio.HideLoadingWindow();
                this.UpdateStatus("Ready");
            });
        }
예제 #4
0
        private void Classify()
        {
            if (this.classifier == null || this.classifier.HasUpdates /* update flag */)
            {
                this.classifier = new GestureClassifier();
                this.classifier.ProblemFile = this.featureFilePath;
                this.classifier.ModelFile = this.modelFilePath;
                this.classifier.CategoryDetected += classifier_CategoryDetected;
                GestureStudio.DisplayLoadingWindow("Loading Image Classifier...");
                this.classifier.BeginInitialize(() =>
                    {
                        GestureStudio.HideLoadingWindow();
                    });            
            }

            if (this.classifier.Initialized)
            {
                this.UpdateStatus("Classifying");
                this.classifier.ClassifyImage(this.croppedFrame);
            }
            else
            {
                this.UpdateStatus("Loading Classifier...");
            }
        }
예제 #5
0
        public void Stop()
        {
            this.mode = ProgramMode.Idle;
            this.UpdateStatus("Ready");

            // reset classifier/trainer
            this.classifier = null;
            this.trainer = null;
        }
예제 #6
0
 public void BeginInitialize()
 {
     this.floodFill = new FloodFill();
     this.mode = ProgramMode.Idle;
     this.classifier = null;
     this.trainer = null;
     this.featureFilePath = null;
     this.modelFilePath = null;
     
     GestureStudio.DisplayLoadingWindow("Loading Kinect Sensor...");
     ThreadPool.QueueUserWorkItem((state) =>
     {
         // init kinect
         this.StartKinectSensor();
         GestureStudio.HideLoadingWindow();
         this.UpdateStatus("Ready");
     });
 }