Fraktur Alphabet OCR in C

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

126 wiecej jeżyków

IronOCR to komponent oprogramowania C#, pozwalający programistom .NET odczytywać tekst z obrazów i dokumentów PDF w 126 językach, w tym w Alfabecie Fraktur.

Jest to zaawansowany fork Tesseract, stworzony wyłącznie dla programistów .NET i regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.

Zawartość IronOcr.Languages.Fraktur

Ten pakiet zawiera 70 języków OCR dla .NET:

  • FrakturAlphabet
  • FrakturAlphabetBest
  • FrakturAlphabetFast

Pobieranie

Fraktur Alphabet Language Pack [Generic Fraktur]

Instalacja

Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszego pakietu OCR Alfabetu Fraktur do projektu .NET.

Install-Package IronOcr.Languages.Fraktur

Przyklad kodu

Ten przykład kodu C# odczytuje tekst Alfabetu Fraktur z obrazu lub dokumentu PDF.

// 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

W tym przykładzie:

  • Tworzymy obiekt IronTesseract, który służy jako nasz silnik OCR.
  • Zmieniamy ustawienie języka na Fraktur, używając OcrLanguage.Fraktur.
  • Ładujemy plik obrazu (@"images\Fraktur.png") do obiektu OcrInput.
  • Metoda Ocr.Read() przetwarza obraz wejściowy i zwraca wynik OCR.
  • Na koniec wyświetlamy wyodrębniony tekst na konsoli.