public MainForm() { InitializeComponent(); m_UnitsComboBox.SelectedIndex = 0; bool useCamera = false; if (useCamera) { m_Capture = new Capture(); } else { m_Capture = new Capture(@"C:\svnDev\oss\Google\drh-visual-odometry\TestVideos\2010-07-18 11-10-22.853.wmv"); m_Timer.Interval = 33; m_Timer.Enabled = true; } CameraParameters cameraParameters = CameraParameters.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus12\1280x720\MicrosoftCinemaFocus12_1280x720.txt"); HomographyMatrix GroundProjectionTransformation = HomographyMatrixSupport.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus12\1280x720\BirdsEyeViewTransformationForCalculation.txt"); m_GroundProjectionTransformationForUI = HomographyMatrixSupport.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus12\1280x720\BirdsEyeViewTransformationForUI.txt"); m_VisualOdometer = new VisualOdometer(m_Capture, cameraParameters, GroundProjectionTransformation, new OpticalFlow()); UpdateFromModel(); m_VisualOdometer.Changed += new EventHandler(OnVisualOdometerChanged); Application.Idle += OnApplicationIdle; }
internal void Update(VisualOdometer visualOdometer) { if (!this.Created) { return; } List <double> headingChanges = visualOdometer.RotationAnalyzer.MeasuredRotationIncrements; if (headingChanges.Count == 0) { return; } double[] degreeAngles = new double[headingChanges.Count]; for (int i = 0; i < headingChanges.Count; i++) { degreeAngles[i] = headingChanges[i] * s_RadToDegree; } m_Histogram.Fill(degreeAngles); m_HistogramSeries.Points.Clear(); for (int i = 0; i < m_Histogram.BinsCount; i++) { HistogramBin bin = m_Histogram[i]; // Add data point into the histogram series double x = (bin.Min + bin.Max) / 2.0; m_HistogramSeries.Points.AddXY(x, bin.Count); } m_CurrentHeadingChangeSeries.Points.Clear(); m_CurrentHeadingChangeSeries.Points.AddXY(visualOdometer.RotationAnalyzer.HeadingChange.Degrees, 0); m_CurrentHeadingChangeAnnotation.AnchorDataPoint = m_CurrentHeadingChangeSeries.Points[0]; }
public AuxiliaryViewsForm(MainForm mainForm, VisualOdometer visualOdometer, HomographyMatrix groundProjectionTransformation) { InitializeComponent(); this.ShowInTaskbar = false; m_MainForm = mainForm; m_VisualOdometer = visualOdometer; m_GroundProjectionTransformation = groundProjectionTransformation; }
public MainForm() { InitializeComponent(); CameraParameters cameraParameters = null; HomographyMatrix groundProjectionTransformation = null; bool useCamera = false; _CamIP = Prompt.ShowDialog("OK para testes", "Conexão Camara"); if (_CamIP != "") { useCamera = true; } if (useCamera) { //Emgu.CV.CvInvoke.cvCreateFileCapture("http://*****:*****@cam_address/axis-cgi/mjpg/video.cgi?resolution=1280x720&req_fps=30&.mjpg"); m_Capture = new Capture(0); m_Capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1280); m_Capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 720); cameraParameters = CameraParameters.Load(@"..\..\CalibrationFiles\MicrosoftCinemaFocus12.txt"); groundProjectionTransformation = HomographyMatrixSupport.Load(@"..\..\CalibrationFiles\BirdsEyeViewTransformationForCalculation.txt"); } else { m_Capture = new Capture(@"..\..\CalibrationFiles\2010-07-18 11-10-22.853.wmv"); m_Timer.Interval = 33; m_Timer.Enabled = true; cameraParameters = CameraParameters.Load(@"..\..\CalibrationFiles\MicrosoftCinemaFocus12.txt"); groundProjectionTransformation = HomographyMatrixSupport.Load(@"..\..\CalibrationFiles\BirdsEyeViewTransformationForCalculation.txt"); } m_VisualOdometer = new VisualOdometer(m_Capture, cameraParameters, groundProjectionTransformation, new OpticalFlow()); UpdateFromModel(); m_VisualOdometer.Changed += new EventHandler(OnVisualOdometerChanged); Application.Idle += OnApplicationIdle; if (m_MapForm == null || m_MapForm.IsDisposed) { m_MapForm = new MapForm(m_RobotPath); } m_MapForm.Show(); }
public MainForm() { InitializeComponent(); m_UnitsComboBox.SelectedIndex = 0; CameraParameters cameraParameters = null; HomographyMatrix groundProjectionTransformation = null; bool useCamera = false; if (useCamera) { m_Capture = new Capture(); m_Capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1280); m_Capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 720); cameraParameters = CameraParameters.Load(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"CalibrationFiles\MicrosoftCinema\Focus14\1280x720\MicrosoftCinemaFocus14_1280x720.txt"); groundProjectionTransformation = HomographyMatrixSupport.Load(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"CalibrationFiles\MicrosoftCinema\Focus14\1280x720\BirdsEyeViewTransformationForCalculation.txt"); m_GroundProjectionTransformationForUI = HomographyMatrixSupport.Load(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"CalibrationFiles\MicrosoftCinema\Focus14\1280x720\BirdsEyeViewTransformationForUI.txt"); } else { m_Capture = new Capture(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"TestVideos\testvideo.wmv"); m_Timer.Interval = 33; m_Timer.Enabled = true; cameraParameters = CameraParameters.Load(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"CalibrationFiles\MicrosoftCinema\Focus12\1280x720\MicrosoftCinemaFocus12_1280x720.txt"); groundProjectionTransformation = HomographyMatrixSupport.Load(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"CalibrationFiles\MicrosoftCinema\Focus12\1280x720\BirdsEyeViewTransformationForCalculation.txt"); m_GroundProjectionTransformationForUI = HomographyMatrixSupport.Load(ConfigurationSettings.AppSettings["RootFilePath"].ToString() + @"CalibrationFiles\MicrosoftCinema\Focus12\1280x720\BirdsEyeViewTransformationForUI.txt"); } m_VisualOdometer = new VisualOdometer(m_Capture, cameraParameters, groundProjectionTransformation, new OpticalFlow()); UpdateFromModel(); m_VisualOdometer.Changed += new EventHandler(OnVisualOdometerChanged); Application.Idle += OnApplicationIdle; }
public MainForm() { InitializeComponent(); m_UnitsComboBox.SelectedIndex = 0; CameraParameters cameraParameters = null; HomographyMatrix groundProjectionTransformation = null; bool useCamera = false; if (useCamera) { m_Capture = new Capture(); m_Capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1280); m_Capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 720); cameraParameters = CameraParameters.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus14\1280x720\MicrosoftCinemaFocus14_1280x720.txt"); groundProjectionTransformation = HomographyMatrixSupport.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus14\1280x720\BirdsEyeViewTransformationForCalculation.txt"); m_GroundProjectionTransformationForUI = HomographyMatrixSupport.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus14\1280x720\BirdsEyeViewTransformationForUI.txt"); } else { m_Capture = new Capture(@"C:\svnDev\oss\Google\drh-visual-odometry\TestVideos\2010-07-18 11-10-22.853.wmv"); m_Timer.Interval = 33; m_Timer.Enabled = true; cameraParameters = CameraParameters.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus12\1280x720\MicrosoftCinemaFocus12_1280x720.txt"); groundProjectionTransformation = HomographyMatrixSupport.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus12\1280x720\BirdsEyeViewTransformationForCalculation.txt"); m_GroundProjectionTransformationForUI = HomographyMatrixSupport.Load(@"C:\svnDev\oss\Google\drh-visual-odometry\CalibrationFiles\MicrosoftCinema\Focus12\1280x720\BirdsEyeViewTransformationForUI.txt"); } m_VisualOdometer = new VisualOdometer(m_Capture, cameraParameters, groundProjectionTransformation, new OpticalFlow()); UpdateFromModel(); m_VisualOdometer.Changed += new EventHandler(OnVisualOdometerChanged); Application.Idle += OnApplicationIdle; }
internal void Update(VisualOdometer visualOdometer) { if (!this.Created) { return; } List<double> headingChanges = visualOdometer.RotationAnalyzer.MeasuredRotationIncrements; if (headingChanges.Count == 0) { return; } double[] degreeAngles = new double[headingChanges.Count]; for (int i = 0; i < headingChanges.Count; i++) { degreeAngles[i] = headingChanges[i] * s_RadToDegree; } m_Histogram.Fill(degreeAngles); m_HistogramSeries.Points.Clear(); for (int i = 0; i < m_Histogram.BinsCount; i++) { HistogramBin bin = m_Histogram[i]; // Add data point into the histogram series double x = (bin.Min + bin.Max) / 2.0; m_HistogramSeries.Points.AddXY(x, bin.Count); } m_CurrentHeadingChangeSeries.Points.Clear(); m_CurrentHeadingChangeSeries.Points.AddXY(visualOdometer.RotationAnalyzer.HeadingChange.Degrees, 0); m_CurrentHeadingChangeAnnotation.AnchorDataPoint = m_CurrentHeadingChangeSeries.Points[0]; }