Tigrinya OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

Mais 126 idiomas

O IronOCR é um componente de software C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o tigrínia. 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.Tigrinya

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

  • Tigrinha
  • TigrinhaBest
  • TigrinhaFast

Baixar

Pacote de idiomas Tigrinya [ትግርኛ]

Instalação

A primeira coisa que precisamos fazer é instalar o pacote OCR Tigrinya no seu projeto .NET.

Install-Package IronOcr.Languages.Tigrinya

Exemplo de código

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

using IronOcr;

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

        // Set the OCR language to Tigrinya
        Ocr.Language = OcrLanguage.Tigrinya;

        // Using statement ensures the OcrInput object is disposed of after use
        using (var Input = new OcrInput(@"images\Tigrinya.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract all text recognized in the image and store it in a variable
            var AllText = Result.Text;

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
using IronOcr;

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

        // Set the OCR language to Tigrinya
        Ocr.Language = OcrLanguage.Tigrinya;

        // Using statement ensures the OcrInput object is disposed of after use
        using (var Input = new OcrInput(@"images\Tigrinya.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract all text recognized in the image and store it in a variable
            var AllText = Result.Text;

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of IronTesseract to perform OCR
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Tigrinya
		Ocr.Language = OcrLanguage.Tigrinya

		' Using statement ensures the OcrInput object is disposed of after use
		Using Input = New OcrInput("images\Tigrinya.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Extract all text recognized in the image and store it in a variable
			Dim AllText = Result.Text

			' Output the extracted text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Explicação

  • IronTesseract : Esta é uma classe especializada do IronOCR usada para realizar reconhecimento de texto.
  • Ocr.Language : Define o idioma usado pelo mecanismo de OCR. Neste caso, está definido como Tigrinya.
  • OcrInput : Representa a fonte de entrada, uma imagem neste caso, que será convertida em texto.
  • Ocr.Read(Input) : Executa OCR na entrada especificada e retorna os resultados.
  • Result.Text : Contém o texto extraído da imagem de entrada após o processo de OCR.
  • Console.WriteLine(AllText) : Exibe o texto extraído no console. Esta linha é opcional e pode ser removida caso a saída no console não seja necessária.