OCR marathi 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 marathi.

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

Ce package contient 46 langues OCR pour .NET :

  • Marathi
  • MarathiMeilleur
  • MarathiFast

Télécharger

Pack de langue marathi [Marathi]

  • Télécharger en tant que Zip
  • Installer avec NuGet

Installation

La première chose à faire est d'installer notre package OCR marathi sur votre projet .NET.

Install-Package IronOCR.Languages.Marathi

Exemple de code

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

// Include the IronOcr namespace
using IronOcr;

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

        // Specify the language as Marathi
        Ocr.Language = OcrLanguage.Marathi;

        // Load the image or PDF document to be processed
        using (var Input = new OcrInput(@"images\Marathi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Get the recognized text
            var AllText = Result.Text;

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

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

        // Specify the language as Marathi
        Ocr.Language = OcrLanguage.Marathi;

        // Load the image or PDF document to be processed
        using (var Input = new OcrInput(@"images\Marathi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Get the recognized text
            var AllText = Result.Text;

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

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

		' Specify the language as Marathi
		Ocr.Language = OcrLanguage.Marathi

		' Load the image or PDF document to be processed
		Using Input = New OcrInput("images\Marathi.png")
			' Perform OCR on the input document
			Dim Result = Ocr.Read(Input)

			' Get the recognized text
			Dim AllText = Result.Text

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

Explication :

Ce code utilise la classe IronTesseract de la bibliothèque IronOCR pour effectuer la reconnaissance optique de caractères (OCR).

  • La propriété Ocr.Language est configurée pour utiliser le pack de langue marathi.
  • Un OcrInput est créé à partir du chemin d'accès à l'image ou au PDF contenant le texte marathi.
  • La méthode Ocr.Read() traite l'entrée et extrait le texte.
  • Le texte reconnu est stocké dans la variable AllText et affiché dans la console.