Skip to content

Commit

Permalink
clarified process of automatic ocr pattern creation a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Dec 3, 2022
1 parent 844551d commit 216629a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 68 deletions.
130 changes: 65 additions & 65 deletions ARKBreedingStats/ocr/OCRControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions ARKBreedingStats/ocr/OCRControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,13 @@ private void buttonLoadCalibrationImage_Click(object sender, EventArgs e)

string fontFilePath = null;
foreach (var c in fontSizesChars)
ArkOcr.Ocr.CreateOcrTemplatesFromFontFile(c.Key, c.Value, _fontFilePath, ref fontFilePath);
{
if (!ArkOcr.Ocr.CreateOcrTemplatesFromFontFile(c.Key, c.Value, _fontFilePath, ref fontFilePath))
return; // user probably cancelled font selection
}
_fontFilePath = fontFilePath;

MessageBoxes.ShowMessageBox($"OCR patterns created for the set labels", "OCR patterns created", MessageBoxIcon.Information);
MessageBoxes.ShowMessageBox("OCR patterns created for the set labels", "OCR patterns created", MessageBoxIcon.Information);

string filePath = Properties.Settings.Default.ocrFile;
if (!string.IsNullOrEmpty(filePath))
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/ocr/OCRControl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ If you edited the file, click on "Load replacings" to update the used data.</val
On the next two tabs the OCR can be adjusted, this can be done if you don't have an ocr-config-file for your used resolution, or if a letter is often misrecognized.</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>Add multiple custom character OCR patterns based on a font-file. Enter all the characters you want to use in the text-field, set the font-size in px and click Calibrate from Font.
<value>Add multiple custom character OCR patterns with set font size based on a font-file. Enter all the characters you want to use in the text-field, set the font-size in px and click Calibrate from Font.
ARK currently uses the font Sansation Bold for its UI.</value>
</data>
</root>

0 comments on commit 216629a

Please sign in to comment.