private void Open()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Title            = ScreenManagerLang.dlgCameraCalibration_OpenDialogTitle;
            openFileDialog.Filter           = ScreenManagerLang.FileFilter_XML;
            openFileDialog.FilterIndex      = 1;
            openFileDialog.InitialDirectory = Software.CameraCalibrationDirectory;

            if (openFileDialog.ShowDialog() != DialogResult.OK || string.IsNullOrEmpty(openFileDialog.FileName))
            {
                return;
            }

            DistortionParameters dp = DistortionImporterKinovea.Import(openFileDialog.FileName, calibrationHelper.ImageSize);

            if (dp != null)
            {
                distortionParameters = dp;
                distorter.Initialize(distortionParameters, calibrationHelper.ImageSize);

                AfterImport();
                PopulatePhysicalParameters();
                PopulateValues();
                UpdateDistortionGrid();
            }
        }
示例#2
0
        private void Save()
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Title            = ScreenManagerLang.dlgCameraCalibration_SaveDialogTitle;
            saveFileDialog.Filter           = ScreenManagerLang.FileFilter_XML;
            saveFileDialog.FilterIndex      = 1;
            saveFileDialog.InitialDirectory = Software.CameraCalibrationDirectory;

            if (saveFileDialog.ShowDialog() != DialogResult.OK || string.IsNullOrEmpty(saveFileDialog.FileName))
            {
                return;
            }

            DistortionImporterKinovea.Export(saveFileDialog.FileName, distorter.Parameters, calibrationHelper.ImageSize);
        }