Sundanese 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 sundanês.

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.Línguas.Sundanês

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

  • Sundanês
  • SundaneseBest
  • Jejum sundanês

Baixar

Pacote de idioma sudanês [Basa Sunda]

Instalação

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

Install-Package IronOcr.Languages.Sundanese

Exemplo de código

Este exemplo de código C# lê texto em sundanês de uma imagem ou documento PDF.

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Specify the language the OCR engine should use
        Ocr.Language = OcrLanguage.Sundanese;

        // Initialize the OCR input with an image file containing Sundanese text
        using (var Input = new OcrInput(@"images\Sundanese.png"))
        {
            // Process the input and get the result
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Specify the language the OCR engine should use
        Ocr.Language = OcrLanguage.Sundanese;

        // Initialize the OCR input with an image file containing Sundanese text
        using (var Input = new OcrInput(@"images\Sundanese.png"))
        {
            // Process the input and get the result
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

Explicação

  • Primeiro, importamos o namespace IronOcr para usar sua funcionalidade de OCR.
  • Uma instância de IronTesseract é criada, que atua como nosso principal mecanismo de OCR.
  • Definimos a propriedade Language para OcrLanguage.Sundanese para especificar que o mecanismo deve esperar ler texto em Sundanês.
  • Criamos um objeto OcrInput para especificar a fonte do arquivo de imagem para nosso mecanismo de OCR.
  • O método Read processa a entrada e tenta reconhecer o texto.
  • O texto reconhecido é armazenado na variável AllText e subsequentemente impresso no console.

Essa configuração permite o reconhecimento robusto de texto em língua sundanesa a partir de imagens, utilizando a biblioteca IronOCR em um ambiente .NET.