Tajik 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 tajique.

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

Este pacote contém 40 idiomas de OCR for .NET:

  • Tajique
  • TajikMelhor
  • TajikFast

Baixar

Pacote de idioma tadjique [тоҷикӣ]

Instalação

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

Install-Package IronOcr.Languages.Tajik

Exemplo de código

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

// Import the IronOcr namespace to use its functionality
using IronOcr;

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

        // Specify the language to use for OCR as Tajik
        Ocr.Language = OcrLanguage.Tajik;

        // Load the image file where the OCR is to be performed
        using (var Input = new OcrInput(@"images\Tajik.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to use its functionality
using IronOcr;

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

        // Specify the language to use for OCR as Tajik
        Ocr.Language = OcrLanguage.Tajik;

        // Load the image file where the OCR is to be performed
        using (var Input = new OcrInput(@"images\Tajik.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

            // Output the text to the console
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel
  • Crie uma instância de IronTesseract para usar as funcionalidades de OCR.
  • Defina a propriedade de idioma para OcrLanguage.Tajik para especificar que o OCR deve processar no idioma Tajique.
  • Carregar a imagem de entrada da qual o texto precisa ser extraído.
  • O método Ocr.Read processa a imagem e retorna o resultado contendo o texto extraído.
  • Acesse a propriedade Text do resultado para obter todo o texto detectado na imagem.