OCR lao en C# et .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this 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 lao.

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.Lao

Ce package contient plusieurs modèles de langage OCR pour .NET :

  • Travail
  • TravailBest
  • TravailFast
  • Alphabet lao
  • Alphabet laoBest
  • Alphabet laoFast

Télécharger

Pack de langue lao [Langue lao]

  • Télécharger au format ZIP
  • Installer avec NuGet

Installation

La première chose à faire est d'installer le package OCR Lao dans votre projet .NET.

Install-Package IronOCR.Languages.Lao

Exemple de code

Cet exemple de code C# lit du texte lao à partir d'une image ou d'un document PDF.

// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;

// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);
    // Extract all text from the OCR result
    var AllText = Result.Text;

    // Output the recognized text for verification
    Console.WriteLine(AllText);
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;

// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);
    // Extract all text from the OCR result
    var AllText = Result.Text;

    // Output the recognized text for verification
    Console.WriteLine(AllText);
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr

' Create a new IronTesseract instance
Private Ocr = New IronTesseract()
' Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao

' Use a using statement to ensure proper disposal of resources
Using Input = New OcrInput("images\Lao.png")
	' Perform OCR on the input image
	Dim Result = Ocr.Read(Input)
	' Extract all text from the OCR result
	Dim AllText = Result.Text

	' Output the recognized text for verification
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Explication :

  • Ce code montre comment configurer et utiliser IronOCR pour effectuer une reconnaissance optique de caractères (OCR) spécifiquement pour la langue lao.
  • IronTesseract est la classe principale utilisée pour effectuer les opérations OCR.
  • La langue est définie sur le lao via Ocr.Language .
  • OcrInput est une classe utilisée pour charger des images ou des documents PDF en vue d'un traitement OCR.
  • La méthode Ocr.Read traite l'entrée et renvoie un résultat contenant le texte reconnu.
  • L'instruction using garantit que les ressources sont libérées après utilisation. Enfin, le texte reconnu est imprimé sur la console pour vérification.