Catalan 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 catalan.
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.Catalan
Ce package contient 46 langues OCR for .NET :
- Catalan
- CatalanBest
- CatalanFast
Télécharger
Pack de langue catalane [català]
Installation
La première chose à faire est d'installer notre package OCR catalan sur votre projet .NET.
Install-Package IronOcr.Languages.Catalan
Exemple de code
Cet exemple de code C# lit du texte catalan à partir d'une image ou d'un document PDF.
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
class CatalanOcrExample
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the language for OCR processing to Catalan
Ocr.Language = OcrLanguage.Catalan;
// Define the input image or PDF from which you want to read the text
using (var Input = new OcrInput(@"images\Catalan.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Retrieve all recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
class CatalanOcrExample
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the language for OCR processing to Catalan
Ocr.Language = OcrLanguage.Catalan;
// Define the input image or PDF from which you want to read the text
using (var Input = new OcrInput(@"images\Catalan.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Retrieve all recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr
Friend Class CatalanOcrExample
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Set the language for OCR processing to Catalan
Ocr.Language = OcrLanguage.Catalan
' Define the input image or PDF from which you want to read the text
Using Input = New OcrInput("images\Catalan.png")
' Perform OCR reading on the input
Dim Result = Ocr.Read(Input)
' Retrieve all recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Class
Dans ce code :
- Nous créons une instance de
IronTesseractpour gérer les opérations OCR. - Le
Ocr.Languageest spécifié comme catalan, indiquant que le moteur OCR doit traiter les images en utilisant le modèle de langue catalan. - Nous utilisons
OcrInputpour spécifier le chemin d'accès au fichier image ou au document PDF. - La méthode
Readest appelée sur l'objetOcr, et les résultats de lecture OCR sont stockés dans la variableResult. - Enfin,
Result.Textcontient le texte reconnu, qui est imprimé sur la console.

