mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 19:52:48 +01:00
Fixed name spaces for OCR forms + minor fix for guessing "min line with"
This commit is contained in:
parent
874caecf77
commit
9f6c98f9b5
@ -13,6 +13,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Forms.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Forms.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Forms.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core.SpellCheck;
|
||||
using Nikse.SubtitleEdit.Forms.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
2
src/Forms/Ocr/AddToOcrReplaceList.Designer.cs
generated
2
src/Forms/Ocr/AddToOcrReplaceList.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
partial class AddToOcrReplaceList
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Dictionaries;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Dictionaries;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public partial class AddToOcrReplaceList : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/OCRSpellCheck.Designer.cs
generated
2
src/Forms/Ocr/OCRSpellCheck.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class OcrSpellCheck
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class OcrSpellCheck : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/VobSubCharactersImport.Designer.cs
generated
2
src/Forms/Ocr/VobSubCharactersImport.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class VobSubCharactersImport
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubCharactersImport : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/VobSubEditCharacters.Designer.cs
generated
2
src/Forms/Ocr/VobSubEditCharacters.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class VobSubEditCharacters
|
||||
{
|
||||
|
@ -1,14 +1,14 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubEditCharacters : Form
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
partial class VobSubNOcrCharacterInspect
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public partial class VobSubNOcrCharacterInspect : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/VobSubNOcrEdit.Designer.cs
generated
2
src/Forms/Ocr/VobSubNOcrEdit.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
partial class VobSubNOcrEdit
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public partial class VobSubNOcrEdit : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/VobSubNOcrTrain.Designer.cs
generated
2
src/Forms/Ocr/VobSubNOcrTrain.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
partial class VobSubNOcrTrain
|
||||
{
|
||||
|
@ -1,8 +1,4 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
@ -10,8 +6,12 @@ using System.Drawing.Text;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public partial class VobSubNOcrTrain : Form
|
||||
{
|
||||
|
4
src/Forms/Ocr/VobSubOcr.Designer.cs
generated
4
src/Forms/Ocr/VobSubOcr.Designer.cs
generated
@ -1,6 +1,6 @@
|
||||
using Nikse.SubtitleEdit.Controls;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class VobSubOcr
|
||||
{
|
||||
@ -307,7 +307,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Name = "inspectImageCompareMatchesForCurrentImageToolStripMenuItem";
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Text = "Inspect compare matches for current image";
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Click += new System.EventHandler(this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click);
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Click += new System.EventHandler(this.InspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click);
|
||||
//
|
||||
// EditLastAdditionsToolStripMenuItem
|
||||
//
|
||||
|
@ -1,18 +1,11 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Core.TransportStream;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@ -20,17 +13,25 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Core.TransportStream;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubOcr : PositionAndSizeForm
|
||||
{
|
||||
internal class CompareItem
|
||||
{
|
||||
public ManagedBitmap Bitmap { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public ManagedBitmap Bitmap { get; }
|
||||
public string Name { get; }
|
||||
public bool Italic { get; set; }
|
||||
public int ExpandCount { get; private set; }
|
||||
public int ExpandCount { get; }
|
||||
public int NumberOfForegroundColors { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
@ -47,9 +48,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
internal class SubPicturesWithSeparateTimeCodes
|
||||
{
|
||||
public SubPicture Picture { get; private set; }
|
||||
public TimeSpan Start { get; private set; }
|
||||
public TimeSpan End { get; private set; }
|
||||
public SubPicture Picture { get; }
|
||||
public TimeSpan Start { get; }
|
||||
public TimeSpan End { get; }
|
||||
|
||||
public SubPicturesWithSeparateTimeCodes(SubPicture subPicture, TimeSpan start, TimeSpan end)
|
||||
{
|
||||
@ -4226,10 +4227,14 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (_ocrFixEngine == null)
|
||||
LoadOcrFixEngine(null, LanguageString);
|
||||
|
||||
string line = string.Empty;
|
||||
var matches = new List<CompareMatch>();
|
||||
var parentBitmap = new NikseBitmap(bitmap);
|
||||
int minLineHeight = _binOcrLastLowercaseHeight - 3;
|
||||
if (_binOcrLastLowercaseHeight == -1 && _nocrLastLowercaseHeight == -1)
|
||||
{ // try to guess lowercase height
|
||||
var letters = NikseBitmapImageSplitter.SplitBitmapToLettersNew(parentBitmap, _numericUpDownPixelsIsSpace, checkBoxRightToLeft.Checked, Configuration.Settings.VobSubOcr.TopToBottom, 6, _ocrCount > 20 ? _ocrHeight : -1);
|
||||
minLineHeight = (int)Math.Round(letters.Where(p => p.NikseBitmap != null).Average(p => p.NikseBitmap.Height) * 0.5);
|
||||
}
|
||||
if (minLineHeight < 5)
|
||||
minLineHeight = _nocrLastLowercaseHeight;
|
||||
if (minLineHeight < 5)
|
||||
@ -7787,7 +7792,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void inspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
private void InspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (subtitleListView1.SelectedItems.Count != 1)
|
||||
return;
|
||||
@ -8851,7 +8856,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
if (subtitleListView1.SelectedItems.Count > 0 && (_ocrMethodIndex == _ocrMethodBinaryImageCompare || _ocrMethodIndex == _ocrMethodImageCompare))
|
||||
{
|
||||
inspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click(null, null);
|
||||
InspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
src/Forms/Ocr/VobSubOcrCharacter.Designer.cs
generated
2
src/Forms/Ocr/VobSubOcrCharacter.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class VobSubOcrCharacter
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubOcrCharacter : Form
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
partial class VobSubOcrCharacterInspect
|
||||
{
|
||||
|
@ -1,15 +1,15 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr.Binary;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubOcrCharacterInspect : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/VobSubOcrNOcrCharacter.Designer.cs
generated
2
src/Forms/Ocr/VobSubOcrNOcrCharacter.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
partial class VobSubOcrNOcrCharacter
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public partial class VobSubOcrNOcrCharacter : Form
|
||||
{
|
||||
|
2
src/Forms/Ocr/VobSubOcrNewFolder.Designer.cs
generated
2
src/Forms/Ocr/VobSubOcrNewFolder.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class VobSubOcrNewFolder
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubOcrNewFolder : Form
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
sealed partial class VobSubOcrSetItalicFactor
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
public sealed partial class VobSubOcrSetItalicFactor : Form
|
||||
{
|
||||
|
@ -10,6 +10,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Forms.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Forms.Ocr;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user