OCR vietnamita en C# y .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR es un componente de software C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el vietnamita.

Es una rama avanzada de Tesseract, construida exclusivamente para desarrolladores de .NET y supera regularmente a otros motores de Tesseract tanto en velocidad como en precisión.

Contenido de IronOcr.Languages.Vietnamese

Este paquete contiene 132 idiomas OCR para .NET:

  • Vietnamita
  • VietnameseBest
  • VietnameseFast
  • VietnameseAlphabet
  • VietnameseAlphabetBest
  • VietnameseAlphabetFast

Descargar

Paquete de idioma vietnamita [Tiếng Việt]

Instalación

Lo primero que tenemos que hacer es instalar nuestro paquete OCR vietnamita en su proyecto .NET.

Install-Package IronOCR.Languages.Vietnamese

Ejemplo de código

Este ejemplo de código en C# lee texto vietnamita de una imagen o documento 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

En este ejemplo de código:

  • Creamos una instancia de IronTesseract.
  • Establezca el idioma en vietnamita usando Ocr.Language = OcrLanguage.Vietnamese;.
  • Cree un objeto OcrInput con la ruta a la imagen o PDF.
  • Llame al método Read para realizar OCR y obtener el texto extraído.
  • El texto extraído se almacena en AllText, que se puede usar según sea necesario, como mostrarlo o guardarlo en un archivo.