/// <summary>
 /// load stereo calibration parameters from file
 /// </summary>
 /// <param name="calibrationFilename"></param>
 public void loadCalibration(String calibrationFilename)
 {
     if (File.Exists(calibrationFilename))
     {
         calibration = new calibrationStereo();
         calibration.Load(calibrationFilename);
         calibration.updateCalibrationMaps();
         stereovision_contours.roll = calibration.positionOrientation.roll;
     }
     else calibration = null;
 }
Пример #2
0
        public scanMatching[] scanmatch;         // simple scan matching

		/// <summary>
		/// constructor
		/// </summary>
		/// <param name="no_of_stereo_cameras">
		/// A <see cref="System.Int32"/>
		/// The number of stereo cameras
		/// </param>
        public stereoHead(int no_of_stereo_cameras) : base(0,0,0)
        {
            this.no_of_stereo_cameras = no_of_stereo_cameras;
            
            // create feature lists
            features = new stereoFeatures[no_of_stereo_cameras];
            
            // store filenames of the images for each camera
            imageFilename = new String[no_of_stereo_cameras * 2];
            
            // create the cameras
            cameraPosition = new pos3D[no_of_stereo_cameras];
            
            // calibration data
            calibration = new calibrationStereo[no_of_stereo_cameras];
            
            // create objects for each stereo camera
            for (int cam = 0; cam < no_of_stereo_cameras; cam++)
            {
                calibration[cam] = new calibrationStereo();
                cameraPosition[cam] = new pos3D(0, 0, 0);
                features[cam] = null; // new stereoFeatures();
            }

            // sensor models
            sensormodel = new rayModelLookup[no_of_stereo_cameras];

            //scan matching
            scanmatch = new scanMatching[no_of_stereo_cameras];

            /*
            if (no_of_cameras == 4) initQuadCam();
            if (no_of_cameras == 2) initDualCam();
            if (no_of_cameras == 1) initSingleStereoCamera(false);
             */
        }
Пример #3
0
        /// <summary>
        /// reset the calibration
        /// </summary>
        private void ResetCalibration()
        {
            calibration_region_of_interest r_left = cam.leftcam.ROI;
            calibration_region_of_interest r_right = cam.rightcam.ROI;
            String DriverName = cam.DriverName;

            cam = new calibrationStereo();
            cam.DriverName = DriverName;
            cam.leftcam.rotation = 0;
            cam.rightcam.rotation = 0;
            cam.leftcam.ROI = r_left;
            cam.rightcam.ROI = r_right;
            cam.baseline = Convert.ToSingle(txtBaseline.Text);
            cam.setCentreSpotPosition(cmbCentreSpotPosition.SelectedIndex);
            cam.leftcam.camera_dist_to_pattern_centre_mm = Convert.ToInt32(txtDistToCentre.Text);
            cam.rightcam.camera_dist_to_pattern_centre_mm = cam.leftcam.camera_dist_to_pattern_centre_mm;
            cam.leftcam.camera_height_mm = Convert.ToInt32(txtCameraHeight.Text);
            cam.rightcam.camera_height_mm = cam.leftcam.camera_height_mm;
            cam.rightcam.separation_factor = cam.leftcam.separation_factor;
            cam.leftcam.camera_FOV_degrees = Convert.ToSingle(txtFOV.Text);
            cam.rightcam.camera_FOV_degrees = cam.leftcam.camera_FOV_degrees;
            cam.leftcam.calibration_pattern_spacing_mm = Convert.ToSingle(txtPatternSpacing.Text);
            cam.rightcam.calibration_pattern_spacing_mm = cam.leftcam.calibration_pattern_spacing_mm;
        }
Пример #4
0
 /// <summary>
 /// set the calibration data
 /// </summary>
 /// <param name="calib"></param>
 public void setCalibration(calibrationStereo calib)
 {
     stereointerface.setCalibration(calib);
 }
 /// <summary>
 /// set the calibration data
 /// </summary>
 /// <param name="calib"></param>
 public void setCalibration(calibrationStereo calib)
 {
     calibration = calib;
     stereovision_contours.roll = calibration.positionOrientation.roll;
 }