Maltese 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 maltais.
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.Maltais
Ce package contient 46 langues OCR for .NET :
- Maltais
- MalteseBest
- MalteseFast
Télécharger
Pack de langue maltaise [Malti]
Installation
La première chose à faire est d'installer notre package OCR maltais sur votre projet .NET.
Install-Package IronOcr.Languages.Maltese
Exemple de code
Cet exemple de code C# lit du texte maltais à partir d'une image ou d'un document PDF.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Maltese
Ocr.Language = OcrLanguage.Maltese;
// Define the input image or PDF document
using (var Input = new OcrInput(@"images\Maltese.png"))
{
// Perform OCR on the input and retrieve the result
var Result = Ocr.Read(Input);
// Get all the recognized text
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Maltese
Ocr.Language = OcrLanguage.Maltese;
// Define the input image or PDF document
using (var Input = new OcrInput(@"images\Maltese.png"))
{
// Perform OCR on the input and retrieve the result
var Result = Ocr.Read(Input);
// Get all the recognized text
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR language to Maltese
Ocr.Language = OcrLanguage.Maltese
' Define the input image or PDF document
Using Input = New OcrInput("images\Maltese.png")
' Perform OCR on the input and retrieve the result
Dim Result = Ocr.Read(Input)
' Get all the recognized text
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Dans cet exemple, le moteur OCR IronTesseract est utilisé pour lire le texte d'un fichier image nommé Maltese.png. Le texte reconnu est ensuite imprimé sur la console. Pour que la reconnaissance optique de caractères (OCR) fonctionne efficacement, assurez-vous que le chemin d'accès à l'image est correct et que le fichier image contient du texte maltais. L'instruction using garantit que les ressources sont correctement éliminées une fois qu'elles ne sont plus nécessaires.

