Fix issue with make-two-color-thresshold - thx Signy13 :)

Fix #4106
This commit is contained in:
Nikolaj Olsson 2020-04-10 13:10:00 +02:00
parent 6c69933898
commit f017ddfb8e
3 changed files with 5 additions and 5 deletions

View File

@ -311,8 +311,8 @@ namespace Nikse.SubtitleEdit.Core
UnicodeSymbolsToInsert = "♪;♫;☺;☹;♥;©;☮;☯;Σ;∞;≡;⇒;π";
SpellCheckAutoChangeNames = true;
OcrFixUseHardcodedRules = true;
OcrBinaryImageCompareRgbThreshold = 270;
OcrTesseract4RgbThreshold = 200;
OcrBinaryImageCompareRgbThreshold = 112;
OcrTesseract4RgbThreshold = 112;
Interjections = "Ah;Ahem;Ahh;Ahhh;Ahhhh;Eh;Ehh;Ehhh;Hm;Hmm;Hmmm;Huh;Mm;Mmm;Mmmm;Phew;Gah;Oh;Ohh;Ohhh;Ow;Oww;Owww;Ugh;Ughh;Uh;Uhh;Uhhh;Whew";
GoogleApiV2KeyInfoShow = true;
GoogleTranslateNoKeyWarningShow = true;

View File

@ -241,7 +241,7 @@
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(790, 481);
this.MinimumSize = new System.Drawing.Size(790, 540);
this.Name = "OcrPreprocessingT4";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View File

@ -1679,7 +1679,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
bTemp.Dispose();
nb = new NikseBitmap(b);
}
nb.MakeTwoColor(Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold, Color.White, Color.Black);
nb.MakeTwoColor(_preprocessingSettings?.BinaryImageCompareThreshold ?? Configuration.Settings.Tools.OcrTesseract4RgbThreshold, Color.White, Color.Black);
returnBmp.Dispose();
return nb.GetBitmap();
}
@ -1757,7 +1757,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
}
}
n.MakeTwoColor(Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold);
n.MakeTwoColor(_preprocessingSettings?.BinaryImageCompareThreshold ?? Configuration.Settings.Tools.OcrBinaryImageCompareRgbThreshold);
returnBmp.Dispose();
return n.GetBitmap();
}