public void Init( string stereo_camera_IP, int leftport, int rightport) { this.stereo_camera_IP = stereo_camera_IP; left_port = leftport; right_port = rightport; string version = String.Format("{0}", AssemblyVersion); Console.WriteLine("surveyorstereo GUI version " + version); Console.WriteLine("SVS IP: " + stereo_camera_IP.ToString()); Console.WriteLine("Left camera port: " + leftport.ToString()); Console.WriteLine("Right camera port: " + rightport.ToString()); stereo_camera = new SurveyorVisionStereoWin(stereo_camera_IP, left_port, right_port, broadcast_port, fps); stereo_camera.temporary_files_path = temporary_files_path; stereo_camera.recorded_images_path = recorded_images_path; stereo_camera.window = this; stereo_camera.display_image[0] = picLeftImage; stereo_camera.display_image[1] = picRightImage; stereo_camera.Load(calibration_filename); stereo_camera.Run("M"); if (stereo_camera.stereo_algorithm_type == StereoVision.EDGES) { denseToolStripMenuItem.Checked = false; simpleToolStripMenuItem.Checked = true; } else { denseToolStripMenuItem.Checked = true; simpleToolStripMenuItem.Checked = false; } txtLogging.Text = path_identifier; txtReplay.Text = replay_path_identifier; SendCommand("M"); motors_active = true; starting = false; }
private void calibrateCameraAlignmentToolStripMenuItem_Click(object sender, EventArgs e) { // stop the cameras in order avoid thread collisions stereo_camera.Stop(); for (int i = 0; i < 100; i++) { System.Threading.Thread.Sleep(5); } if (stereo_camera.CalibrateCameraAlignment()) { stereo_camera.Save(calibration_filename); ShowMessage("Calibration complete"); } else { ShowMessage("Please individually calibrate left and right cameras before the calibrating the focus"); } // restart the cameras stereo_camera.Run(); }