OCR luxembourgeois 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 le luxembourgeois.

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.Languages.Luxembourgeois

Ce package contient 64 langues OCR pour .NET :

  • luxembourgeois
  • LuxembourgishBest
  • LuxembourgishFast

Télécharger

Pack linguistique luxembourgeois [luxembourgeois]

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

Installation

La première chose à faire est d'installer le package OCR luxembourgeois dans votre projet .NET.

Install-Package IronOCR.Languages.Luxembourgish

Exemple de code

Cet exemple de code C# lit du texte luxembourgeois à partir d'une image ou d'un document PDF.

// Import the IronOcr namespace to utilize OCR functions
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract to perform OCR
        var Ocr = new IronTesseract();

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

        // Load the input image or PDF from which to extract the text
        using (var Input = new OcrInput(@"images\Luxembourgish.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Retrieve the recognized text from the result
            var AllText =  Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to utilize OCR functions
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract to perform OCR
        var Ocr = new IronTesseract();

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

        // Load the input image or PDF from which to extract the text
        using (var Input = new OcrInput(@"images\Luxembourgish.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Retrieve the recognized text from the result
            var AllText =  Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace to utilize OCR functions
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of IronTesseract to perform OCR
		Dim Ocr = New IronTesseract()

		' Set the language for OCR to Luxembourgish
		Ocr.Language = OcrLanguage.Luxembourgish

		' Load the input image or PDF from which to extract the text
		Using Input = New OcrInput("images\Luxembourgish.png")
			' Perform OCR on the input document
			Dim Result = Ocr.Read(Input)

			' Retrieve the recognized text from the result
			Dim AllText = Result.Text

			' Output the recognized text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Cet exemple illustre l'utilisation d'IronOCR pour reconnaître du texte luxembourgeois à partir de documents locaux.
  • La langue est configurée sur le luxembourgeois afin d'améliorer la précision de la reconnaissance des textes dans cette langue.
  • OcrInput() est utilisé pour spécifier l'image ou le fichier PDF en entrée.
  • Ocr.Read() traite le document, et le texte reconnu est accessible via Result.Text .