OCR allemand en C# et .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR est un composant logiciel C# permettant aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont l'allemand.

Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET et qui surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Langues.Allemand

Ce package contient 61 langues OCR pour .NET :

  • Allemand
  • AllemandBest
  • AllemandFast
  • AllemandFraktur

Télécharger

Pack de langue allemande [Deutsch]

  • Télécharger au format ZIP
  • Installer avec NuGet

Installation

La première chose à faire est d'installer notre package OCR allemand sur votre projet .NET.

Install-Package IronOCR.Languages.German

Exemple de code

Cet exemple de code C# lit du texte allemand à partir d'une image ou d'un document 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

Dans cet exemple, IronTesseract est configuré pour utiliser la langue allemande pour la reconnaissance optique de caractères (OCR), ce qui est nécessaire pour le traitement des images ou des fichiers PDF contenant du texte en allemand. La classe OcrInput est utilisée pour spécifier le fichier image, et la méthode Read effectue l'opération OCR, renvoyant le texte extrait.