OCR portugués 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 .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el portugués.

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

Contenido de IronOcr.Languages.Portuguese

Este paquete contiene 55 idiomas OCR para .NET:

  • Portugués
  • PortugueseBest
  • PortugueseFast

Descargar

Paquete de idioma portugués [português]

Instalación

Lo primero que tenemos que hacer es instalar nuestro paquete OCR en portugués en su proyecto .NET.

Install-Package IronOCR.Languages.Portuguese

Ejemplo de código

Este ejemplo de código C# lee texto en portugués de una imagen o documento PDF.

// Required using directive for IronOcr
using IronOcr;

var Ocr = new IronTesseract();

// Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese;

// Load the image or PDF from which to read the text
using (var Input = new OcrInput(@"images\Portuguese.png"))
{
    // Perform OCR on the input
    var Result = Ocr.Read(Input);

    // Retrieve the recognized text
    var AllText = Result.Text;

    // Output the extracted text
    Console.WriteLine(AllText);
}
// Required using directive for IronOcr
using IronOcr;

var Ocr = new IronTesseract();

// Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese;

// Load the image or PDF from which to read the text
using (var Input = new OcrInput(@"images\Portuguese.png"))
{
    // Perform OCR on the input
    var Result = Ocr.Read(Input);

    // Retrieve the recognized text
    var AllText = Result.Text;

    // Output the extracted text
    Console.WriteLine(AllText);
}
' Required using directive for IronOcr
Imports IronOcr

Private Ocr = New IronTesseract()

' Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese

' Load the image or PDF from which to read the text
Using Input = New OcrInput("images\Portuguese.png")
	' Perform OCR on the input
	Dim Result = Ocr.Read(Input)

	' Retrieve the recognized text
	Dim AllText = Result.Text

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

Este código demuestra cómo configurar y utilizar la biblioteca IronOCR para leer texto en portugués de una imagen. Asegúrese de que la ruta a la imagen o documento PDF sea correcta. El texto reconocido se almacenará en la variable AllText y se imprimirá en la consola.