OCR de afrikáans 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 en C# que permite a los codificadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el afrikáans.

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

Este paquete contiene 52 idiomas de OCR para .NET:

  • Afrikaans
  • AfrikaansBest
  • AfrikaansFast

Descargar

Paquete de idioma afrikáans [Afrikaans]

Instalación

Lo primero que tenemos que hacer es instalar nuestro paquete OCR de Afrikaans en tu proyecto .NET.

Install-Package IronOCR.Languages.Afrikaans

Ejemplo de código

Este ejemplo de código en C# lee texto en afrikáans de una imagen o documento PDF.

// First, ensure the IronOcr.Languages.Afrikaans package is installed in your project.
// This example requires the IronOcr C# package to read text from images or PDFs.

using IronOcr;

var Ocr = new IronTesseract(); // Initialize the IronTesseract class
Ocr.Language = OcrLanguage.Afrikaans; // Set the language to Afrikaans

// Load the image or PDF document into an OcrInput object
using (var Input = new OcrInput(@"images\Afrikaans.png"))
{
    // Perform OCR on the input document
    var Result = Ocr.Read(Input);

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

    // Output the recognized text (this step is customizable for your use-case)
    Console.WriteLine(AllText);
}
// First, ensure the IronOcr.Languages.Afrikaans package is installed in your project.
// This example requires the IronOcr C# package to read text from images or PDFs.

using IronOcr;

var Ocr = new IronTesseract(); // Initialize the IronTesseract class
Ocr.Language = OcrLanguage.Afrikaans; // Set the language to Afrikaans

// Load the image or PDF document into an OcrInput object
using (var Input = new OcrInput(@"images\Afrikaans.png"))
{
    // Perform OCR on the input document
    var Result = Ocr.Read(Input);

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

    // Output the recognized text (this step is customizable for your use-case)
    Console.WriteLine(AllText);
}
' First, ensure the IronOcr.Languages.Afrikaans package is installed in your project.
' This example requires the IronOcr C# package to read text from images or PDFs.

Imports IronOcr

Private Ocr = New IronTesseract() ' Initialize the IronTesseract class
Ocr.Language = OcrLanguage.Afrikaans ' Set the language to Afrikaans

' Load the image or PDF document into an OcrInput object
Using Input = New OcrInput("images\Afrikaans.png")
	' Perform OCR on the input document
	Dim Result = Ocr.Read(Input)

	' Retrieve the complete recognized text
	Dim AllText = Result.Text

	' Output the recognized text (this step is customizable for your use-case)
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Explicación:

  • IronTesseract: Esta clase es parte de la biblioteca IronOCR y se utiliza para configurar el proceso de OCR.
  • OcrLanguage: Esta propiedad establece el idioma para el OCR. Aquí está configurado a afrikáans.
  • OcrInput: Esta clase encapsula el archivo de entrada para el proceso de OCR. Admite varios formatos de imagen y archivos PDF.
  • Ocr.Read(): Este método ejecuta el proceso de OCR y devuelve el texto reconocido envuelto en un objeto de resultado.
  • Result.Text: Esta propiedad contiene el texto extraído del documento de entrada.