コード例 #1
0
        public FormCalibrateDistortion(Bitmap currentImage, List <List <PointF> > points, CalibrationHelper calibrationHelper)
        {
            this.currentImage      = currentImage;
            this.calibrationHelper = calibrationHelper;

            if (calibrationHelper.DistortionHelper == null || !calibrationHelper.DistortionHelper.Initialized)
            {
                distorter.Initialize(DistortionParameters.Default, calibrationHelper.ImageSize);
                bmpUndistorted = currentImage;
            }
            else
            {
                distorter.Initialize(calibrationHelper.DistortionHelper.Parameters, calibrationHelper.ImageSize);
            }

            calibrator = new CameraCalibrator(points, calibrationHelper.ImageSize);

            InitializeComponent();
            LocalizeForm();

            mnuOpen.Click          += (s, e) => Open();
            mnuSave.Click          += (s, e) => Save();
            mnuImportAgisoft.Click += (s, e) => ImportAgisoft();
            mnuDefault.Click       += (s, e) => RestoreDefaults();
            mnuQuit.Click          += (s, e) => Close();

            if (currentImage == null)
            {
                tabPages.TabPages.Remove(tabImage);
            }

            btnCalibrate.Enabled = calibrator.Valid;

            Populate();
        }
コード例 #2
0
        public FormCalibrateDistortion(Bitmap currentImage, List <List <PointF> > points, CalibrationHelper calibrationHelper)
        {
            this.bmpCurrentImage   = currentImage;
            this.calibrationHelper = calibrationHelper;

            if (calibrationHelper.DistortionHelper == null || !calibrationHelper.DistortionHelper.Initialized)
            {
                distortionParameters = new DistortionParameters(calibrationHelper.ImageSize);
            }
            else
            {
                distortionParameters = calibrationHelper.DistortionHelper.Parameters;
            }

            distorter.Initialize(distortionParameters, calibrationHelper.ImageSize);
            calibrator = new CameraCalibrator(points, calibrationHelper.ImageSize);

            InitializeComponent();
            LocalizeForm();

            SetupStyle();
            PopulateStyleElements();

            mnuOpen.Click          += (s, e) => Open();
            mnuSave.Click          += (s, e) => Save();
            mnuImportAgisoft.Click += (s, e) => ImportAgisoft();
            mnuDefault.Click       += (s, e) => RestoreDefaults();
            mnuQuit.Click          += (s, e) => Close();

            btnCalibrate.Enabled = calibrator.Valid;
            AfterImport();
            PopulatePhysicalParameters();
            PopulateValues();
            UpdateDistortionGrid();
        }