Example #1
0
        public MainWindow()
        {
            InitializeComponent();
            kinectController = new KinectTracker();

            kinectController.setEventColorReady(drawColorImage);

            if (kinectController.isConnected())
            {
                kinectController.start();

                // Show the default values of the Kinect settings
                double initialTheta = kinectController.settings.theta / (Math.PI / 180);
                //thetaTextBox.Text = initialTheta.ToString();
                //thetaTrackBar.Value = (int)initialTheta;

                int initialK = kinectController.settings.k;
                //kTextBox.Text = initialK.ToString();
                //kTrackBar.Value = initialK;

                float initialNearSpace = kinectController.settings.nearSpacePerc;
                //NearSpaceTextBox.Text = initialNearSpace.ToString();
                //NearSpaceTrackBar.Value = (int)(initialNearSpace * 100);

                textMarginLeft.Text = kinectController.settings.marginLeftPerc.ToString();
                textMarginRight.Text = kinectController.settings.marginRightPerc.ToString();
                textMarginTop.Text = kinectController.settings.marginTopPerc.ToString();
                textMarginBot.Text = kinectController.settings.marginBotPerc.ToString();

                //smoothTextBox.Text = kinectController.settings.smoothingIterations.ToString();
                //smoothTrackBar.Value = kinectController.settings.smoothingIterations;

                //boxReductionTextBox.Text = ((int)(kinectController.settings.containerBoxReduction * 100)).ToString();
                //boxReductionTrackBar.Value = (int)(kinectController.settings.containerBoxReduction * 100);
            }
            else
            {
                // Show an error
                Console.WriteLine("Kinect device unavailable. Please connect Kinect and restart.\n");
            }
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            kinectController = new KinectTracker();

            kinectController.setEventColorReady(drawColorImage);

            if (kinectController.isConnected())
            {
                kinectController.start();

                // Show the default values of the Kinect settings
                double initialTheta = kinectController.settings.theta / (Math.PI / 180);
                //thetaTextBox.Text = initialTheta.ToString();
                //thetaTrackBar.Value = (int)initialTheta;

                int initialK = kinectController.settings.k;
                //kTextBox.Text = initialK.ToString();
                //kTrackBar.Value = initialK;

                float initialNearSpace = kinectController.settings.nearSpacePerc;
                //NearSpaceTextBox.Text = initialNearSpace.ToString();
                //NearSpaceTrackBar.Value = (int)(initialNearSpace * 100);

                textMarginLeft.Text  = kinectController.settings.marginLeftPerc.ToString();
                textMarginRight.Text = kinectController.settings.marginRightPerc.ToString();
                textMarginTop.Text   = kinectController.settings.marginTopPerc.ToString();
                textMarginBot.Text   = kinectController.settings.marginBotPerc.ToString();

                //smoothTextBox.Text = kinectController.settings.smoothingIterations.ToString();
                //smoothTrackBar.Value = kinectController.settings.smoothingIterations;

                //boxReductionTextBox.Text = ((int)(kinectController.settings.containerBoxReduction * 100)).ToString();
                //boxReductionTrackBar.Value = (int)(kinectController.settings.containerBoxReduction * 100);
            }
            else
            {
                // Show an error
                Console.WriteLine("Kinect device unavailable. Please connect Kinect and restart.\n");
            }
        }