OCR maltés en C# y .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR es un componente de software C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el maltés.

Es una versión avanzada de Tesseract, construida exclusivamente para desarrolladores de .NET y que supera regularmente a otros motores Tesseract tanto en velocidad como en precisión.

Contenido de IronOcr.Languages.Maltese

Este paquete contiene 46 idiomas OCR para .NET:

  • Maltés
  • MalteseBest
  • MalteseFast

Descargar

Paquete de idioma maltés [Malti]

Instalación

Lo primero que debemos hacer es instalar nuestro paquete OCR maltés en tu proyecto .NET.

Install-Package IronOCR.Languages.Maltese

Ejemplo de código

Este ejemplo de código C# lee texto en maltés de una imagen o 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

En este ejemplo, se utiliza el motor OCR IronTesseract para leer texto de un archivo de imagen llamado Maltese.png. El texto reconocido se imprime luego en la consola. Asegúrate de que la ruta de la imagen sea correcta y de que el archivo de imagen contenga texto en maltés para que el OCR funcione de manera efectiva. La instrucción using asegura que los recursos se desechen adecuadamente una vez que ya no son necesarios.