Italian 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 l'italien.
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.Italien
Ce package contient 6 modes de langue OCR for .NET :
- Italien
- ItalianBest
- ItalianFast
- ItalianOld
- ItalianOldBest
- Vieux-déjeuner italien
Télécharger
Pack de langue italienne [italiano]
Installation
La première chose à faire est d'installer le package OCR italien sur votre projet .NET.
Install-Package IronOcr.Languages.Italian
Exemple de code
Cet exemple de code C# lit du texte italien à partir d'une image ou d'un document PDF.
// Include IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Italian
Ocr.Language = OcrLanguage.Italian;
// Read text from an image file
using (var Input = new OcrInput(@"images\Italian.png"))
{
// Perform OCR to get the text content from the image
var Result = Ocr.Read(Input);
// Get and print all the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}
// Include IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Italian
Ocr.Language = OcrLanguage.Italian;
// Read text from an image file
using (var Input = new OcrInput(@"images\Italian.png"))
{
// Perform OCR to get the text content from the image
var Result = Ocr.Read(Input);
// Get and print all the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}
' Include IronOcr library
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Set the OCR language to Italian
Ocr.Language = OcrLanguage.Italian
' Read text from an image file
Using Input = New OcrInput("images\Italian.png")
' Perform OCR to get the text content from the image
Dim Result = Ocr.Read(Input)
' Get and print all the recognized text
Dim AllText = Result.Text
Console.WriteLine(AllText)
End Using
End Sub
End Class
Explication :
- Utilisation IronOCR : La bibliothèque
IronOcrest incluse pour utiliser ses capacités OCR. - Création d'une instance IronTesseract :
IronTesseractest une classe de base utilisée pour le traitement OCR. - Paramétrage de la langue : L'OCR est configuré pour traiter la langue italienne en utilisant
Ocr.Language = OcrLanguage.Italian. - Lecture de l'entrée : Un objet
OcrInputest créé pour spécifier le fichier image. - Exécution de l'OCR :
Ocr.Read(Input)exécute le processus OCR sur l'image d'entrée et renvoie le résultat textuel. - Sortie : Le texte résultant est stocké dans
AllTextet affiché dans la console.
Assurez-vous que le chemin d'accès au fichier images\Italian.png est correct et que le fichier existe pour que l'exemple fonctionne correctement.

