Using Custom OCR Language Packs with IronOCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

Wie erstellt man benutzerdefinierte Sprachpakete zur Verwendung in IronOCR?

Das Erstellen eines benutzerdefinierten Sprachpakets erfordert das Training einer neuen Tesseract 4 LSTM Sprachdatei/Wörterbuch aus einer Schriftart.

Es gibt viele Tutorials online, die die erforderlichen Schritte dafür erklären. Der Prozess ist nicht einfach, aber zum Glück recht gut dokumentiert.

As a good place to start, we suggest this YouTube tutorial from Gabriel Garcia (no affiliation) and their linked GitHub repository.

Nach Abschluss wird die Ausgabe eine .traineddata-Datei sein.

Die .traineddata-Datei kann dann in IronOCR wie folgt referenziert werden:

Dokumentation: IronOCR Custom Languages

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
$vbLabelText   $csharpLabel
Curtis Chau
Technischer Autor

Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender ...

Weiterlesen
Bereit anzufangen?
Nuget Downloads 5,044,537 | Version: 2025.11 gerade veröffentlicht