OCR de l'alphabet grec 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, y compris l'alphabet grec.

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.Greek

Ce package contient 102 langues OCR pour .NET :

  • Grec
  • GreekBest
  • GreekFast
  • Alphabet grec
  • Meilleur alphabet grec
  • Alphabet grec rapide

Télécharger

Pack de langue de l'alphabet grec [\u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac]<\/span>

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

Installation

La première étape consiste à installer le package OCR de l'alphabet grec dans votre projet .NET.

Install-Package IronOCR.Languages.Greek

Exemple de code

Cet exemple de code C# lit le texte de l'alphabet grec à partir d'une image ou d'un document PDF.

// Import the IronOcr namespace
using IronOcr;

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

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

        // Load the image or PDF containing Greek text
        using (var Input = new OcrInput(@"images\Greek.png"))
        {
            // Perform OCR and get the result
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

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

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

        // Load the image or PDF containing Greek text
        using (var Input = new OcrInput(@"images\Greek.png"))
        {
            // Perform OCR and get the result
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

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

		' Set the OCR language to Greek
		Ocr.Language = OcrLanguage.Greek

		' Load the image or PDF containing Greek text
		Using Input = New OcrInput("images\Greek.png")
			' Perform OCR and get the result
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Output the recognized text
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • IronTesseract : Cette classe est responsable de l'exécution de l'opération OCR.
  • OcrInput : Cette classe est utilisée pour charger les images ou les fichiers PDF pour le traitement OCR.
  • Ocr.Read() : Méthode permettant d'effectuer la reconnaissance optique de caractères (OCR) sur les données d'entrée et de fournir le texte reconnu.

Avant d'exécuter ce code, assurez-vous que la bibliothèque IronOcr et le pack de langue grecque sont correctement installés dans votre projet .NET. Ce code affichera le texte extrait de l'image située à l'emplacement images/Greek.png .