mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Minor fixes for ocr window (better Tesseract errror + don't fallback to line-ocr if max error < 1% in binary-image-compate)
This commit is contained in:
parent
69b33abd36
commit
307a6f9e66
@ -309,7 +309,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private int _numericUpDownPixelsIsSpace = 6;
|
||||
private double _numericUpDownMaxErrorPct = 6;
|
||||
private int _ocrMethodIndex;
|
||||
private bool _autoBreakLines = false;
|
||||
private bool _autoBreakLines;
|
||||
|
||||
private int _ocrMethodTesseract = 0;
|
||||
private int _ocrMethodImageCompare = 1;
|
||||
@ -4256,7 +4256,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
CompareMatch match = GetCompareMatchNew(item, out bestGuess, list, index);
|
||||
if (match == null) // Try line OCR if no image compare match
|
||||
{
|
||||
if (_nOcrDb != null && _nOcrDb.OcrCharacters.Count > 0)
|
||||
if (_nOcrDb != null && _nOcrDb.OcrCharacters.Count > 0 && _numericUpDownMaxErrorPct < 1)
|
||||
match = GetNOcrCompareMatchNew(item, parentBitmap, _nOcrDb, true, true);
|
||||
}
|
||||
|
||||
@ -5881,7 +5881,14 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show("Unable to start 'Tesseract' - make sure tesseract-ocr 3.x is installed!");
|
||||
if (Configuration.IsRunningOnLinux() || Configuration.IsRunningOnMac())
|
||||
{
|
||||
MessageBox.Show("Unable to start 'Tesseract' - make sure tesseract-ocr 3.x is installed!");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Unable to start 'Tesseract' (" + Configuration.TesseractFolder + "tesseract.exe) - make sure tesseract-ocr 3.x is installed!");
|
||||
}
|
||||
throw;
|
||||
}
|
||||
process.WaitForExit(5000);
|
||||
|
Loading…
Reference in New Issue
Block a user