Marathi OCR in C# and .NET
Autres versions de ce 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 for .NET :
- Marathi
- MarathiMeilleur
- MarathiFast
Télécharger
Pack de langue marathi [Marathi]
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
Explication :
- Ce code utilise la classe
IronTesseractde la bibliothèqueIronOCRpour effectuer la reconnaissance optique de caractères (OCR). - La propriété
Ocr.Languageest configurée pour utiliser le pack de langue marathi. - Un
OcrInputest créé en utilisant le 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
AllTextet est affiché dans la console.

