German OCR in C# and .NET

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

IronOCR to komponent oprogramowania C#, który pozwala programistom .NET odczytywać tekst z obrazów i dokumentów PDF w 126 językach, w tym po niemiecku.

Jest to zaawansowany fork Tesseracta, zbudowany wyłącznie dla deweloperów .NET i regularnie przewyższający inne silniki Tesseract pod względem szybkości i dokładności.

Zawartość IronOcr.Languages.German

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

  • Niemiecki
  • NiemieckiBest
  • NiemieckiFast
  • NiemieckiFraktur

Pobieranie

German Language Pack [Deutsch]

Instalacja

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

Install-Package IronOcr.Languages.German

Przyklad kodu

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

using IronOcr;

var Ocr = new IronTesseract();
// Set the OCR language to German. This must match the language of the document you are scanning.
Ocr.Language = OcrLanguage.German;

using (var Input = new OcrInput(@"images\German.png"))
{
    // Perform OCR on the provided image and get the result.
    var Result = Ocr.Read(Input);
    // Extract all recognized text from the OCR result.
    var AllText = Result.Text;
    // Optionally, output the recognized text to the console for verification.
    Console.WriteLine(AllText);
}
using IronOcr;

var Ocr = new IronTesseract();
// Set the OCR language to German. This must match the language of the document you are scanning.
Ocr.Language = OcrLanguage.German;

using (var Input = new OcrInput(@"images\German.png"))
{
    // Perform OCR on the provided image and get the result.
    var Result = Ocr.Read(Input);
    // Extract all recognized text from the OCR result.
    var AllText = Result.Text;
    // Optionally, output the recognized text to the console for verification.
    Console.WriteLine(AllText);
}
Imports IronOcr

Private Ocr = New IronTesseract()
' Set the OCR language to German. This must match the language of the document you are scanning.
Ocr.Language = OcrLanguage.German

Using Input = New OcrInput("images\German.png")
	' Perform OCR on the provided image and get the result.
	Dim Result = Ocr.Read(Input)
	' Extract all recognized text from the OCR result.
	Dim AllText = Result.Text
	' Optionally, output the recognized text to the console for verification.
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

W tym przykładzie, IronTesseract jest skonfigurowane do używania języka niemieckiego dla OCR, co jest konieczne do przetwarzania obrazów lub PDF-ów zawierających niemiecki tekst. Klasa OcrInput jest używana do określenia pliku obrazu, a metoda Read wykonuje operację OCR, zwracając wyodrębniony tekst.