Ejemplo n.º 1
0
        public void Stop()
        {
            this.mode = ProgramMode.Idle;
            this.UpdateStatus("Ready");

            // reset classifier/trainer
            this.classifier = null;
            this.trainer    = null;
        }
Ejemplo n.º 2
0
        private void Train()
        {
            if (this.trainer == null)
            {
                this.trainer             = new GestureLearner();
                this.trainer.ProblemFile = this.featureFilePath;

                this.trainer.ImageCollectionFinished += trainer_ImageCollectionFinished;
                this.trainer.NewModelReady           += trainer_NewModelReady;
                GestureStudio.DisplayLoadingWindow("Loading Gesture Trainer...");
                this.trainer.BeginInitialize(() =>
                {
                    GestureStudio.HideLoadingWindow();
                });
            }
            else if (this.trainer.CurrentSampleCount == 0)
            {
            }

            if (this.trainer.Initialized)
            {
                if (!this.trainer.GestureDataReady)
                {
                    this.UpdateStatus("Collecting Gesture " + this.trainer.CurrentSampleCount + " of 30");
                    this.trainer.LearnGesture(this.croppedFrame);
                }
                else if (!this.trainer.ModelBuildStarted)
                {
                    this.UpdateStatus("Building Prediction Model...");

                    GestureStudio.DisplayLoadingWindow("Building Prediction Model...");
                    this.trainer.BuildModel(() =>
                    {
                        GestureStudio.HideLoadingWindow();
                    });
                }
                else
                {
                    // training finished
                    this.Stop();
                }
            }
            else
            {
                // waiting for init, do nothing
            }
        }
Ejemplo n.º 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");
            });
        }
Ejemplo n.º 4
0
        private void Train()
        {
            if (this.trainer == null)
            {
                this.trainer = new GestureLearner();
                this.trainer.ProblemFile = this.featureFilePath;

                this.trainer.ImageCollectionFinished += trainer_ImageCollectionFinished;
                this.trainer.NewModelReady += trainer_NewModelReady;
                GestureStudio.DisplayLoadingWindow("Loading Gesture Trainer...");
                this.trainer.BeginInitialize(() =>
                {
                    GestureStudio.HideLoadingWindow();
                });
            }
            else if (this.trainer.CurrentSampleCount == 0)
            {

            }

            if (this.trainer.Initialized)
            {
                if (!this.trainer.GestureDataReady)
                {
                    this.UpdateStatus("Collecting Gesture " + this.trainer.CurrentSampleCount + " of 30");
                    this.trainer.LearnGesture(this.croppedFrame);
                }
                else if (!this.trainer.ModelBuildStarted)
                {
                    this.UpdateStatus("Building Prediction Model...");

                    GestureStudio.DisplayLoadingWindow("Building Prediction Model...");
                    this.trainer.BuildModel(() =>
                    {
                        GestureStudio.HideLoadingWindow();
                    });
                }
                else
                {
                    // training finished
                    this.Stop();
                }
            }
            else
            {
                // waiting for init, do nothing
            }
        }
Ejemplo n.º 5
0
        public void Stop()
        {
            this.mode = ProgramMode.Idle;
            this.UpdateStatus("Ready");

            // reset classifier/trainer
            this.classifier = null;
            this.trainer = null;
        }
Ejemplo n.º 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");
     });
 }