Sundanese OCR in C# and .NET
Autres versions de ce document :
- En langue soundanaise
- 125 langues supplémentaires pour la reconnaissance optique de caractères (OCR)
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 soundanais.
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.Sundanese
Ce package contient 52 langues OCR for .NET :
- Soundanais
- SundaneseBest
- SundanaisFast
Télécharger
Pack linguistique sundanais [sundanais]
Installation
La première chose à faire est d'installer notre package OCR sundanais sur votre projet .NET.
Install-Package IronOcr.Languages.Sundanese
Exemple de code
Cet exemple de code C# lit du texte sundanais à partir d'une image ou d'un document PDF.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Specify the language the OCR engine should use
Ocr.Language = OcrLanguage.Sundanese;
// Initialize the OCR input with an image file containing Sundanese text
using (var Input = new OcrInput(@"images\Sundanese.png"))
{
// Process the input and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text from the result
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Specify the language the OCR engine should use
Ocr.Language = OcrLanguage.Sundanese;
// Initialize the OCR input with an image file containing Sundanese text
using (var Input = new OcrInput(@"images\Sundanese.png"))
{
// Process the input and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text from the result
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Specify the language the OCR engine should use
Ocr.Language = OcrLanguage.Sundanese
' Initialize the OCR input with an image file containing Sundanese text
Using Input = New OcrInput("images\Sundanese.png")
' Process the input and get the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the result
Dim AllText = Result.Text
' Output the recognized text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
Explication
- Nous importons d'abord l'espace de noms
IronOcrpour utiliser sa fonctionnalité OCR. - Une instance de
IronTesseractest créée, qui sert de moteur OCR principal. - Nous avons défini la propriété
LanguagesurOcrLanguage.Sundanesepour spécifier que le moteur doit s'attendre à lire du texte sundanais. - Nous créons un objet
OcrInputpour spécifier la source du fichier image pour notre moteur OCR. - La méthode
Readtraite l'entrée et tente de reconnaître le texte. - Le texte reconnu est stocké dans la variable
AllTextet ensuite imprimé sur la console.
Cette configuration permet une reconnaissance fiable du texte en langue soundanaise à partir d'images grâce à la bibliothèque IronOCR dans un environnement .NET.

