OCR panjabi 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 panjabi. 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.Panjabi

Ce package contient 46 langues OCR pour .NET :

  • Panjabi
  • PanjabiBest
  • PanjabiFast

Télécharger

Pack de langue panjabi [Panjabi]

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

Installation

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

Install-Package IronOCR.Languages.Panjabi

Exemple de code

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

// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to Panjabi
        Ocr.Language = OcrLanguage.Panjabi;

        // Define the input image or PDF file
        using (var Input = new OcrInput(@"images\Panjabi.png"))
        {
            // Perform OCR on the input file
            var Result = Ocr.Read(Input);

            // Extract and store the recognized text from the OCR result
            var AllText = Result.Text;
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to Panjabi
        Ocr.Language = OcrLanguage.Panjabi;

        // Define the input image or PDF file
        using (var Input = new OcrInput(@"images\Panjabi.png"))
        {
            // Perform OCR on the input file
            var Result = Ocr.Read(Input);

            // Extract and store the recognized text from the OCR result
            var AllText = Result.Text;
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

		' Set the language to Panjabi
		Ocr.Language = OcrLanguage.Panjabi

		' Define the input image or PDF file
		Using Input = New OcrInput("images\Panjabi.png")
			' Perform OCR on the input file
			Dim Result = Ocr.Read(Input)

			' Extract and store the recognized text from the OCR result
			Dim AllText = Result.Text
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Explication

  • IronTesseract : Il s'agit de la classe principale fournie par IronOCR pour les opérations OCR.
  • Ocr.Language : Nous spécifions la langue que le moteur OCR doit utiliser. Ici, le texte est en panjabi.
  • OcrInput : Cette classe est utilisée pour spécifier le fichier d'entrée (image ou PDF) sur lequel l'OCR doit être réalisé.
  • Ocr.Read() : Cette méthode effectue la tâche OCR proprement dite et renvoie un résultat contenant le texte extrait.
  • Result.Text : Contient le texte extrait après l'application de la reconnaissance optique de caractères (OCR) au fichier d'entrée.

Cet exemple démontre comment utiliser efficacement la bibliothèque IronOCR pour extraire du texte panjabi à partir d'images ou de documents PDF dans une application .NET.