Update Tesseract OCR to 5.3.1

This commit is contained in:
niksedk 2023-06-10 10:32:07 +02:00
parent 77344c4e85
commit 017cf8026e
3 changed files with 10 additions and 4 deletions

View File

@ -24,7 +24,7 @@ namespace Nikse.SubtitleEdit.Core.Common
public static readonly string ShotChangesDirectory = DataDirectory + "ShotChanges" + Path.DirectorySeparatorChar;
public static readonly string AutoBackupDirectory = DataDirectory + "AutoBackup" + Path.DirectorySeparatorChar;
public static readonly string VobSubCompareDirectory = DataDirectory + "VobSub" + Path.DirectorySeparatorChar;
public static readonly string TesseractDirectory = DataDirectory + "Tesseract530" + Path.DirectorySeparatorChar;
public static readonly string TesseractDirectory = DataDirectory + "Tesseract531" + Path.DirectorySeparatorChar;
public static readonly string Tesseract302Directory = DataDirectory + "Tesseract302" + Path.DirectorySeparatorChar;
public static readonly string WaveformsDirectory = DataDirectory + "Waveforms" + Path.DirectorySeparatorChar;
public static readonly string PluginsDirectory = DataDirectory + "Plugins";

View File

@ -10,7 +10,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
{
public sealed partial class DownloadTesseract5 : Form
{
public const string TesseractDownloadUrl = "https://github.com/SubtitleEdit/support-files/raw/master/Tesseract530.zip";
public const string TesseractDownloadUrl = "https://github.com/SubtitleEdit/support-files/raw/master/Tesseract531.zip";
private readonly CancellationTokenSource _cancellationTokenSource;
public DownloadTesseract5(string version)

View File

@ -330,7 +330,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
// Dictionaries/spellchecking/fixing
private OcrFixEngine _ocrFixEngine;
private int _tesseractOcrAutoFixes;
private string Tesseract5Version = "5.3.0";
private string Tesseract5Version = "5.3.1";
private Subtitle _bdnXmlOriginal;
private Subtitle _bdnXmlSubtitle;
@ -7108,7 +7108,13 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
checkBoxTesseractFallback.Text = string.Format(LanguageSettings.Current.VobSubOcr.FallbackToX, "Tesseract 3.02");
if (Configuration.IsRunningOnWindows && !File.Exists(Path.Combine(Configuration.TesseractDirectory, "tesseract.exe")))
{
if (MessageBox.Show($"{LanguageSettings.Current.GetTesseractDictionaries.Download} Tesseract {Tesseract5Version}", LanguageSettings.Current.General.Title, MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
if (IntPtr.Size * 8 == 32)
{
MessageBox.Show("Sorry, Tesseract {Tesseract5Version} requires a 64-bit processor");
comboBoxOcrMethod.SelectedIndex = _ocrMethodBinaryImageCompare;
return;
}
else if (MessageBox.Show($"{LanguageSettings.Current.GetTesseractDictionaries.Download} Tesseract {Tesseract5Version}", LanguageSettings.Current.General.Title, MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
{
comboBoxTesseractLanguages.Items.Clear();
using (var form = new DownloadTesseract5(Tesseract5Version))