OCR galicien 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# qui permet aux développeurs .NET d'extraire du texte à partir d'images et de documents PDF dans 126 langues, dont le galicien.

Il s'agit d'une version avancée de Tesseract, conçue spécifiquement pour les développeurs .NET, et qui surpasse systématiquement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Languages.Galicien

Ce package contient 49 langues OCR pour .NET, dont :

  • Galicien
  • GalicianBest
  • GalicienFast

Télécharger

Pack de langue galicien [galego]

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

Installation

La première étape pour utiliser le package OCR galicien dans votre projet .NET consiste à l'installer.

Install-Package IronOCR.Languages.Galician

Exemple de code

L'exemple de code C# suivant montre comment lire du texte galicien à partir d'une image ou d'un document PDF.

// Include the IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Specify the language for OCR as Galician
        Ocr.Language = OcrLanguage.Galician;

        // Define the input source, here it is an image file
        using (var Input = new OcrInput(@"images\Galician.png"))
        {
            // Perform the OCR process on the input image
            var Result = Ocr.Read(Input);

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

            // Output the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Include the IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Specify the language for OCR as Galician
        Ocr.Language = OcrLanguage.Galician;

        // Define the input source, here it is an image file
        using (var Input = new OcrInput(@"images\Galician.png"))
        {
            // Perform the OCR process on the input image
            var Result = Ocr.Read(Input);

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

            // Output the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Include the IronOcr library
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Instantiate the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Specify the language for OCR as Galician
		Ocr.Language = OcrLanguage.Galician

		' Define the input source, here it is an image file
		Using Input = New OcrInput("images\Galician.png")
			' Perform the OCR process on the input image
			Dim Result = Ocr.Read(Input)

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

			' Output the extracted text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Dans le code ci-dessus :

  • Nous utilisons la classe IronTesseract pour créer un objet moteur OCR.
  • Nous avons configuré la langue de l'OCR sur le galicien, ce qui garantit que le moteur OCR traite avec précision le texte galicien.
  • Nous lisons ensuite le fichier image " images\Galician.png " et obtenons le texte.
  • Enfin, nous affichons le texte reconnu dans la console.