コード例 #1
0
        public OcrPreprocessingT4(Bitmap bitmap, PreprocessingSettings preprocessingSettings)
        {
            InitializeComponent();
            _source = new NikseBitmap(bitmap);
            pictureBoxSubtitleImage.Image = bitmap;
            if (preprocessingSettings != null)
            {
                PreprocessingSettings = preprocessingSettings;
            }
            else
            {
                PreprocessingSettings = new PreprocessingSettings
                {
                    BinaryImageCompareThreshold = Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold
                };
            }

            numericUpDownThreshold.Value = PreprocessingSettings.BinaryImageCompareThreshold;

            Text = Configuration.Settings.Language.OcrPreprocessing.Title;
            groupBoxBinaryImageCompareThreshold.Text = Configuration.Settings.Language.OcrPreprocessing.BinaryThreshold;
            buttonOK.Text     = Configuration.Settings.Language.General.Ok;
            buttonCancel.Text = Configuration.Settings.Language.General.Cancel;

            RefreshImage();
        }
コード例 #2
0
        public OcrPreprocessingSettings(Bitmap bitmap, bool isBinaryImageCompare, PreprocessingSettings preprocessingSettings)
        {
            _isBinaryImageCompare = isBinaryImageCompare;
            InitializeComponent();
            groupBoxBinaryImageCompareThresshold.Visible = isBinaryImageCompare;
            _source = new NikseBitmap(bitmap);
            pictureBoxSubtitleImage.Image = bitmap;
            if (preprocessingSettings != null)
            {
                PreprocessingSettings = preprocessingSettings;
            }
            else
            {
                PreprocessingSettings = new PreprocessingSettings
                {
                    BinaryImageCompareThresshold = Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold
                };
            }

            checkBoxInvertColors.Checked    = PreprocessingSettings.InvertColors;
            panelColorToWhite.BackColor     = PreprocessingSettings.ColorToWhite;
            panelColorToRemove.BackColor    = PreprocessingSettings.ColorToRemove;
            checkBoxCropTransparent.Checked = PreprocessingSettings.CropTransparentColors;
            checkBoxYellowToWhite.Checked   = PreprocessingSettings.YellowToWhite;
            numericUpDownThreshold.Value    = PreprocessingSettings.BinaryImageCompareThresshold;

            RefreshImage();
        }
コード例 #3
0
        public OcrPreprocessingT4(Bitmap bitmap, PreprocessingSettings preprocessingSettings)
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            UiUtil.FixFonts(this);
            _source = new NikseBitmap(bitmap);
            pictureBoxSubtitleImage.Image = bitmap;
            if (preprocessingSettings != null)
            {
                PreprocessingSettings = preprocessingSettings;
            }
            else
            {
                PreprocessingSettings = new PreprocessingSettings
                {
                    BinaryImageCompareThreshold = Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold
                };
            }

            numericUpDownThreshold.Value = PreprocessingSettings.BinaryImageCompareThreshold;

            Text = LanguageSettings.Current.OcrPreprocessing.Title;
            groupBoxBinaryImageCompareThreshold.Text = LanguageSettings.Current.OcrPreprocessing.BinaryThreshold;
            groupBoxCropping.Text        = LanguageSettings.Current.OcrPreprocessing.Cropping;
            checkBoxCropTransparent.Text = LanguageSettings.Current.OcrPreprocessing.CropTransparentColors;
            buttonOK.Text                   = LanguageSettings.Current.General.Ok;
            buttonCancel.Text               = LanguageSettings.Current.General.Cancel;
            labelOriginalImage.Text         = LanguageSettings.Current.OcrPreprocessing.OriginalImage;
            labelPostImage.Text             = LanguageSettings.Current.OcrPreprocessing.PostImage;
            checkBoxInvertColors.Checked    = preprocessingSettings.InvertColors;
            checkBoxCropTransparent.Checked = preprocessingSettings.CropTransparentColors;
            _loading = false;
            RefreshImage();
            UiUtil.FixLargeFonts(this, buttonOK);
        }
コード例 #4
0
        public OcrPreprocessingSettings(Bitmap bitmap, bool isBinaryImageCompare, PreprocessingSettings preprocessingSettings)
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            UiUtil.FixFonts(this);
            _loading = true;
            _isBinaryImageCompare = isBinaryImageCompare;
            groupBoxBinaryImageCompareThreshold.Visible = isBinaryImageCompare;
            _source = new NikseBitmap(bitmap);
            pictureBoxSubtitleImage.Image = bitmap;
            if (preprocessingSettings != null)
            {
                PreprocessingSettings = preprocessingSettings;
            }
            else
            {
                PreprocessingSettings = new PreprocessingSettings
                {
                    BinaryImageCompareThreshold = Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold
                };
            }

            checkBoxInvertColors.Checked    = PreprocessingSettings.InvertColors;
            panelColorToWhite.BackColor     = PreprocessingSettings.ColorToWhite;
            panelColorToRemove.BackColor    = PreprocessingSettings.ColorToRemove;
            checkBoxCropTransparent.Checked = PreprocessingSettings.CropTransparentColors;
            checkBoxYellowToWhite.Checked   = PreprocessingSettings.YellowToWhite;
            trackBarThresshold.Minimum      = (int)numericUpDownThreshold.Minimum;
            trackBarThresshold.Maximum      = (int)numericUpDownThreshold.Maximum;
            numericUpDownThreshold.Value    = PreprocessingSettings.BinaryImageCompareThreshold;
            trackBarThresshold.Value        = PreprocessingSettings.BinaryImageCompareThreshold;

            Text = LanguageSettings.Current.OcrPreprocessing.Title;
            groupBoxColors.Text        = LanguageSettings.Current.OcrPreprocessing.Colors;
            checkBoxInvertColors.Text  = LanguageSettings.Current.OcrPreprocessing.InvertColors;
            checkBoxYellowToWhite.Text = LanguageSettings.Current.OcrPreprocessing.YellowToWhite;
            buttonColorToWhite.Text    = LanguageSettings.Current.OcrPreprocessing.ColorToWhite;
            buttonColorToRemove.Text   = LanguageSettings.Current.OcrPreprocessing.ColorToRemove;
            buttonColorToRemove.Text   = LanguageSettings.Current.OcrPreprocessing.ColorToRemove;
            groupBoxBinaryImageCompareThreshold.Text = LanguageSettings.Current.OcrPreprocessing.BinaryThreshold;
            labelThresholdDescription.Text           = LanguageSettings.Current.OcrPreprocessing.AdjustAlpha;
            groupBoxCropping.Text        = LanguageSettings.Current.OcrPreprocessing.Cropping;
            checkBoxCropTransparent.Text = LanguageSettings.Current.OcrPreprocessing.CropTransparentColors;
            labelOriginalImage.Text      = LanguageSettings.Current.OcrPreprocessing.OriginalImage;
            labelPostImage.Text          = LanguageSettings.Current.OcrPreprocessing.PostImage;
            buttonOK.Text     = LanguageSettings.Current.General.Ok;
            buttonCancel.Text = LanguageSettings.Current.General.Cancel;

            _loading = false;
            RefreshImage();
            UiUtil.FixLargeFonts(this, buttonOK);
        }
コード例 #5
0
        public OcrPreprocessingT4(Bitmap bitmap, PreprocessingSettings preprocessingSettings)
        {
            InitializeComponent();
            _source = new NikseBitmap(bitmap);
            pictureBoxSubtitleImage.Image = bitmap;
            if (preprocessingSettings != null)
            {
                PreprocessingSettings = preprocessingSettings;
            }
            else
            {
                PreprocessingSettings = new PreprocessingSettings
                {
                    BinaryImageCompareThresshold = Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold
                };
            }

            numericUpDownThreshold.Value = PreprocessingSettings.BinaryImageCompareThresshold;

            RefreshImage();
        }