Fraktur Alphabet OCR in C#

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

126 Weitere Sprachen

IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 languages, including Fraktur Alphabet.

Es ist eine fortschrittliche Abspaltung von Tesseract, die ausschließlich für .NET-Entwickler gebaut wurde und regelmäßig andere Tesseract-Engines sowohl in Geschwindigkeit als auch Genauigkeit übertrifft.

Contents of IronOcr.Languages.Fraktur

This package contains 70 OCR languages for .NET:

  • FrakturAlphabet
  • FrakturAlphabetBest
  • FrakturAlphabetFast

Download

Fraktur Alphabet Language Pack [Generic Fraktur]

Installation

The first thing we have to do is install our Fraktur Alphabet OCR package into your .NET project.

Install-Package IronOCR.Languages.Fraktur

Beispielcode

This C# code example reads Fraktur Alphabet text from an Image or PDF document.

// Requires the IronOcr NuGet package and the Fraktur language package to be installed.

using IronOcr;

class FrakturOCRExample
{
    static void Main()
    {
        // Create an instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Set the OCR language to Fraktur
        Ocr.Language = OcrLanguage.Fraktur;

        // Load the image containing Fraktur text
        using (var Input = new OcrInput(@"images\Fraktur.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Retrieve and display the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
// Requires the IronOcr NuGet package and the Fraktur language package to be installed.

using IronOcr;

class FrakturOCRExample
{
    static void Main()
    {
        // Create an instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Set the OCR language to Fraktur
        Ocr.Language = OcrLanguage.Fraktur;

        // Load the image containing Fraktur text
        using (var Input = new OcrInput(@"images\Fraktur.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Retrieve and display the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
' Requires the IronOcr NuGet package and the Fraktur language package to be installed.

Imports IronOcr

Friend Class FrakturOCRExample
	Shared Sub Main()
		' Create an instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Fraktur
		Ocr.Language = OcrLanguage.Fraktur

		' Load the image containing Fraktur text
		Using Input = New OcrInput("images\Fraktur.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Retrieve and display the recognized text
			Dim AllText = Result.Text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

In diesem Beispiel:

  • We create an IronTesseract object which serves as our OCR engine.
  • We change the language setting to Fraktur using OcrLanguage.Fraktur.
  • We load an image file (@"images\Fraktur.png") into an OcrInput object.
  • The Ocr.Read() method processes the input image and returns the OCR result.
  • Finally, we print the extracted text to the console.