Afrikaans OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Outras versões deste documento:

O IronOCR é um componente de software C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o africâner.

Trata-se de uma versão avançada do Tesseract, criada exclusivamente para desenvolvedores .NET e que supera regularmente outros mecanismos do Tesseract em termos de velocidade e precisão.

Conteúdo de IronOcr.Languages.Afrikaans

Este pacote contém 52 linguagens de OCR for .NET:

  • Afrikaans
  • AfrikaansBest
  • AfrikaansFast

Download

Pacote de idiomas Africâner [Africâner]

Instalação

A primeira coisa que precisamos fazer é instalar nosso pacote de OCR para Afrikaans em seu projeto .NET.

Install-Package IronOcr.Languages.Afrikaans

Exemplo de código

Este exemplo de código C# lê texto em africâner de uma imagem ou 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

Explicação:

  • IronTesseract : Esta classe faz parte da biblioteca IronOCR e é usada para configurar o processo de OCR.
  • OcrLanguage : Esta propriedade define o idioma para OCR. Aqui está configurado para o idioma africâner.
  • OcrInput : Esta classe encapsula o arquivo de entrada para o processo de OCR. Suporta diversos formatos de imagem e arquivos PDF.
  • Ocr.Read() : Este método executa o processo de OCR e retorna o texto reconhecido encapsulado em um objeto de resultado.
  • Result.Text : Esta propriedade contém o texto extraído do documento de entrada.