OCR vietnamien 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 vietnamien.

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

Ce package contient 132 langues OCR pour .NET :

  • Vietnamien
  • Le meilleur vietnamien
  • Vietnamien rapide
  • Alphabet vietnamien
  • Meilleur alphabet vietnamien
  • Alphabet vietnamien rapide

Télécharger

Pack de langue vietnamienne

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

Installation

La première chose à faire est d'installer notre package OCR vietnamien sur votre projet .NET.

Install-Package IronOCR.Languages.Vietnamese

Exemple de code

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

// You need to install the IronOCR.Languages.Vietnamese package using the following NuGet command before running this code:
// PM> Install-Package IronOCR.Languages.Vietnamese

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese;

using (var Input = new OcrInput(@"images\Vietnamese.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Extract all recognized text
    var AllText = Result.Text;

    // Example: Output the extracted text to the console
    Console.WriteLine(AllText);
}
// You need to install the IronOCR.Languages.Vietnamese package using the following NuGet command before running this code:
// PM> Install-Package IronOCR.Languages.Vietnamese

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese;

using (var Input = new OcrInput(@"images\Vietnamese.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Extract all recognized text
    var AllText = Result.Text;

    // Example: Output the extracted text to the console
    Console.WriteLine(AllText);
}
' You need to install the IronOCR.Languages.Vietnamese package using the following NuGet command before running this code:
' PM> Install-Package IronOCR.Languages.Vietnamese

Imports IronOcr

Private Ocr = New IronTesseract()

' Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese

Using Input = New OcrInput("images\Vietnamese.png")
	' Perform OCR on the input image
	Dim Result = Ocr.Read(Input)

	' Extract all recognized text
	Dim AllText = Result.Text

	' Example: Output the extracted text to the console
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Dans cet exemple de code :

  • Nous créons une instance d' IronTesseract .
  • Définir la langue sur vietnamien à l'aide de Ocr.Language = OcrLanguage.Vietnamese; .
  • Créez un objet OcrInput avec le chemin d'accès à l'image ou au PDF.
  • Appelez la méthode Read pour effectuer la reconnaissance optique de caractères (OCR) et obtenir le texte extrait.
  • Le texte extrait est stocké dans AllText , qui peut être utilisé selon les besoins, par exemple pour l'afficher ou l'enregistrer dans un fichier.