Esempio n. 1
0
        private void ProcessFrame()
        {
            m_VisualOdometer.ProcessFrame();
            if (m_VisualOdometer.CurrentImage == null)
            {
                return;
            }

            m_FoundFeaturesCountTextBox.Text   = m_VisualOdometer.InitialFeaturesCount.ToString();
            m_TrackedFeaturesCountTextBox.Text = m_VisualOdometer.TrackedFeatures.Count.ToString();
            m_NotTrackedFeaturesCount.Text     = m_VisualOdometer.NotTrackedFeaturesCount.ToString();

            m_FrameTextBox.Text           = m_VisualOdometer.FramesCounter.FrameNumber.ToString();
            m_FramesPerSecondTextBox.Text = String.Format("{0:0.0}", m_VisualOdometer.FramesCounter.FramesPerSecond);

            m_HeadingTextBox.Text = String.Format(
                "{0:0.000}", m_VisualOdometer.RobotPose.Heading.Degrees);
            m_LocationTextBox.Text = String.Format(
                "({0:0.000}, {1:0.000})", m_VisualOdometer.RobotPose.Location.X * m_UnitFactor, m_VisualOdometer.RobotPose.Location.Y * m_UnitFactor);
            //m_LocationChangeTextBox.Text = String.Format(
            //    "dx_r: {0:0.000}  dy_r: {1:0.000}", m_VisualOdometer.TranslationAnalyzer.LocationChange.X, m_VisualOdometer.TranslationAnalyzer.LocationChange.Y);

            m_PathLengthTextBox.Text        = String.Format("{0:0.000}", m_RobotPath.PathLength * m_UnitFactor);
            m_DistanceFromStartTextBox.Text = String.Format("{0:0.000}", m_RobotPath.DistanceFromStart * m_UnitFactor);

            if (m_ShowImageCheckBox.Checked)
            {
                DrawRegionBounderies();
                m_ImageBox.Image = m_VisualOdometer.CurrentImage;
            }

            Pose newPose = new Pose(m_VisualOdometer.RobotPose);

            m_RobotPath.Add(newPose);

            if (!m_RotationAnalysisForm.IsDisposed)
            {
                m_RotationAnalysisForm.Update(m_VisualOdometer);
            }
            if (m_AuxiliaryViewsForm != null && !m_AuxiliaryViewsForm.IsDisposed)
            {
                m_AuxiliaryViewsForm.Update(m_DrawFeaturesCheckBox.Checked);
            }
            if (m_MapForm != null && !m_MapForm.IsDisposed)
            {
                m_MapForm.UpdateMap();
            }
            if (m_DrawFeaturesCheckBox.Checked)
            {
                DrawAllFeatureLocationsPreviousAndCurrent();
            }
        }
Esempio n. 2
0
        private void ProcessFrame()
        {
            m_VisualOdometer.ProcessFrame();

            if (m_VisualOdometer.CurrentImage == null)
            {
                return;
            }

            m_FramesPerSecondTextBox.Text = String.Format("{0:0.0}", m_VisualOdometer.FramesCounter.FramesPerSecond);

            DrawRegionBounderies();
            m_ImageBox.Image = m_VisualOdometer.CurrentImage;

            Pose newPose = new Pose(m_VisualOdometer.RobotPose);

            m_RobotPath.Add(newPose);

            ObstacleDetector();

            if (m_MapForm != null && !m_MapForm.IsDisposed)
            {
                m_MapForm.UpdateMap();
            }

            if (m_ObstaclesCheckBox.Checked)
            {
                DrawObstacle();
            }

            if (m_DrawFeaturesCheckBox.Checked)
            {
                DrawAllFeatureLocationsPreviousAndCurrent();
            }

            if (m_SurfCheckbox.Checked)
            {
                Image <Gray, Byte> img1 = new Image <Gray, Byte>("../../img.jpg");
                Image <Gray, Byte> img2 = m_VisualOdometer.CurrentImage.Convert <Gray, Byte>();

                executeSURF(img1, img2, m_VisualOdometer.CurrentImage);
            }



            ArtificialInteligence();
        }