mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fix nOCR issue with expanded match
This commit is contained in:
parent
63c8c71e7e
commit
acef8c4fbe
@ -32,7 +32,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
|||||||
UiUtil.FixLargeFonts(this, buttonOK);
|
UiUtil.FixLargeFonts(this, buttonOK);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Initialize(System.Drawing.Bitmap bitmap, int selectedIndex, List<VobSubOcr.CompareMatch> matches, List<ImageSplitterItem> splitterItems)
|
internal void Initialize(Bitmap bitmap, int selectedIndex, List<VobSubOcr.CompareMatch> matches, List<ImageSplitterItem> splitterItems)
|
||||||
{
|
{
|
||||||
_wholeImage = new NikseBitmap(bitmap);
|
_wholeImage = new NikseBitmap(bitmap);
|
||||||
_startIndex = selectedIndex;
|
_startIndex = selectedIndex;
|
||||||
|
@ -385,8 +385,21 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
|||||||
{
|
{
|
||||||
using (var form = new AddBetterMultiMatchNOcr())
|
using (var form = new AddBetterMultiMatchNOcr())
|
||||||
{
|
{
|
||||||
|
var tempImageList = new List<ImageSplitterItem>();
|
||||||
var idx = _indexLookup[listBoxInspectItems.SelectedIndex];
|
var idx = _indexLookup[listBoxInspectItems.SelectedIndex];
|
||||||
form.Initialize(_bitmap, idx, _matchList, _imageList);
|
for (int i = idx; i < _imageList.Count; i++)
|
||||||
|
{
|
||||||
|
tempImageList.Add(_imageList[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var tempMatchList = new List<VobSubOcr.CompareMatch>();
|
||||||
|
idx = listBoxInspectItems.SelectedIndex;
|
||||||
|
for (int i = idx; i < _matchList.Count; i++)
|
||||||
|
{
|
||||||
|
tempMatchList.Add(_matchList[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
form.Initialize(_bitmap, 0, tempMatchList, tempImageList);
|
||||||
if (form.ShowDialog(this) == DialogResult.OK)
|
if (form.ShowDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
_nocrDb.Add(form.NOcrChar);
|
_nocrDb.Add(form.NOcrChar);
|
||||||
|
@ -235,7 +235,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
|||||||
|
|
||||||
private static Point GetTotalSize(int listIndex, List<ImageSplitterItem> items, int count)
|
private static Point GetTotalSize(int listIndex, List<ImageSplitterItem> items, int count)
|
||||||
{
|
{
|
||||||
if (listIndex + count >= items.Count)
|
if (listIndex + count > items.Count)
|
||||||
{
|
{
|
||||||
return new Point(-100, -100);
|
return new Point(-100, -100);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user