OCR Tonga en C# et .NET

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

126 autres langues

IronOCR est un composant logiciel C# qui permet aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont le tongien. C'est une version avancée de Tesseract, exclusivement conçue pour les développeurs .NET, et elle dépasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Languages.Tonga

Ce package contient trois modèles de langue OCR spécifiquement pour le tongien :

  • Arrivé
  • ArrivéBest
  • ArrivéFast

Télécharger

Pack de langue tongienne [Pack de langue tongienne]

  • Télécharger sous forme de fichier Zip .
  • Installer avec NuGet .

Installation

Pour commencer à utiliser les fonctionnalités OCR de Tonga , installez le package Tonga OCR dans votre projet .NET à l'aide de la commande NuGet suivante :

Install-Package IronOCR.Languages.Tonga

Exemple de code

L'exemple de code C# suivant montre comment lire du texte en tonga à partir d'une image ou d'un document PDF à l'aide d'IronOCR.

// Include the necessary IronOcr namespace
using IronOcr;

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

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
// Include the necessary IronOcr namespace
using IronOcr;

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

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
' Include the necessary IronOcr namespace
Imports IronOcr

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

		' Set the OCR engine to use the Tonga language pack
		Ocr.Language = OcrLanguage.Tonga

		' Load the input image or PDF into OcrInput
		Using Input = New OcrInput("images\Tonga.png")
			' Perform OCR to read the text from the image
			Dim Result = Ocr.Read(Input)

			' Retrieve the full text recognition result
			Dim AllText = Result.Text

			' Output the result or process further as needed
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Cet exemple de code illustre l'initialisation du moteur OCR IronTesseract et sa configuration pour utiliser la langue tongienne.
  • Nous chargeons une image à partir du chemin spécifié dans un objet OcrInput .
  • La méthode Ocr.Read() traite l'entrée pour extraire le texte, puis nous récupérons le texte reconnu via la propriété Result.Text . Enfin, le texte extrait peut être affiché ou traité selon les besoins de l'application.