Marathi 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:

IronOCR é um componente de software C# que permite aos desenvolvedores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo Marata.

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údos de IronOcr.Languages.Marathi

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

  • Marata
  • MarathiBest
  • MarathiFast

Baixar

Pacote de Idioma Marata [मराठी]

Instalação

A primeira coisa que precisamos fazer é instalar nosso pacote OCR Marathi no seu projeto .NET.

Install-Package IronOcr.Languages.Marathi

Exemplo de código

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

// Include the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the OCR engine
        var Ocr = new IronTesseract();

        // Specify the language as Marathi
        Ocr.Language = OcrLanguage.Marathi;

        // Load the image or PDF document to be processed
        using (var Input = new OcrInput(@"images\Marathi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to console
            Console.WriteLine(AllText);
        }
    }
}
// Include the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the OCR engine
        var Ocr = new IronTesseract();

        // Specify the language as Marathi
        Ocr.Language = OcrLanguage.Marathi;

        // Load the image or PDF document to be processed
        using (var Input = new OcrInput(@"images\Marathi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

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

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

Explicação:

  • Este código usa a classe IronTesseract da biblioteca IronOCR para realizar OCR.
  • A propriedade Ocr.Language está configurada para usar o pacote de idioma Marathi.
  • Um OcrInput é criado usando o caminho para a imagem ou PDF que contém o texto em Marathi.
  • O método Ocr.Read() processa a entrada e extrai o texto.
  • O texto reconhecido é armazenado na variável AllText e impresso no console.