Maltese 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 maltê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údos de IronOcr.Languages.Maltese

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

  • Maltês
  • MalteseBest
  • MalteseFast

Baixar

Pacote de Idioma Maltês [Malti]

  • Faça o download como Zip
  • Instale com NuGet

Instalação

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

Install-Package IronOcr.Languages.Maltese

Exemplo de código

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

// Import the IronOcr namespace
using IronOcr;

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

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

        // Define the input image or PDF document
        using (var Input = new OcrInput(@"images\Maltese.png"))
        {
            // Perform OCR on the input and retrieve the result
            var Result = Ocr.Read(Input);

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

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

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

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

        // Define the input image or PDF document
        using (var Input = new OcrInput(@"images\Maltese.png"))
        {
            // Perform OCR on the input and retrieve the result
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

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

		' Define the input image or PDF document
		Using Input = New OcrInput("images\Maltese.png")
			' Perform OCR on the input and retrieve the result
			Dim Result = Ocr.Read(Input)

			' Get all the recognized text
			Dim AllText = Result.Text

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

Neste exemplo, o mecanismo OCR IronTesseract é utilizado para ler texto de um arquivo de imagem chamado Maltese.png. O texto reconhecido é então impresso no console. Certifique-se de que o caminho da imagem esteja correto e de que o arquivo de imagem contenha texto em maltês para que o OCR funcione efetivamente. A declaração using garante que os recursos sejam devidamente descartados assim que não forem mais necessários.