IronOCR OCR 프로그램에서 사용자 지정 언어 팩으로 이미지 텍스트 변환하기
IronOCR 에서 사용할 사용자 지정 언어 팩을 만드는 방법은 무엇입니까?
사용자 지정 언어 팩을 만들려면 글꼴에서 새로운 Tesseract 4 LSTM 언어 파일/사전을 학습시켜야 합니다.
이 작업을 수행하는 데 필요한 단계를 설명하는 온라인 튜토리얼이 많이 있습니다. 그 과정은 간단하지 않지만, 다행히도 상당히 잘 기록되어 있습니다.
시작하기 좋은 자료로, Gabriel Garcia (저희와는 아무런 관련이 없습니다)의 YouTube 튜토리얼 과 링크된 GitHub 저장소를 추천합니다.
완료되면 출력은 .traineddata 파일이 됩니다.
.traineddata 파일은 다음과 같이 IronOCR에서 참조할 수 있습니다:
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Load your custom Tesseract language file (trained .traineddata file)
Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata"); //<--- your new font
// Multiple fonts can be used by calling the method multiple times with different files
// Load an image into the OCR Input for processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}
}
}
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Load your custom Tesseract language file (trained .traineddata file)
Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata"); //<--- your new font
// Multiple fonts can be used by calling the method multiple times with different files
// Load an image into the OCR Input for processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}
}
}
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Load your custom Tesseract language file (trained .traineddata file)
Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata") '<--- your new font
' Multiple fonts can be used by calling the method multiple times with different files
' Load an image into the OCR Input for processing
Using Input = New OcrInput("images\image.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
End Using
End Sub
End Class

