OCR en maratí 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 maratí.

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

Contenido de IronOcr.Languages.Marathi

Este paquete contiene 46 idiomas OCR para .NET:

  • Maratí
  • MaratíMejor
  • MaratíRápido

Descargar

Paquete de idioma maratí [मराठी]

Instalación

Lo primero que tenemos que hacer es instalar nuestro paquete OCR de Maratí en tu proyecto .NET.

Install-Package IronOCR.Languages.Marathi

Ejemplo de código

Este ejemplo de código C# lee texto en maratí de una imagen o 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);
        }
    }
}
' Include the IronOcr namespace
Imports IronOcr

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

		' Specify the language as Marathi
		Ocr.Language = OcrLanguage.Marathi

		' Load the image or PDF document to be processed
		Using Input = New OcrInput("images\Marathi.png")
			' Perform OCR on the input document
			Dim Result = Ocr.Read(Input)

			' Get the recognized text
			Dim AllText = Result.Text

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

Explicación:

  • Este código usa la clase IronTesseract de la biblioteca IronOCR para realizar el OCR.
  • La propiedad Ocr.Language se configura para usar el paquete de idioma maratí.
  • Se crea un OcrInput utilizando la ruta a la imagen o PDF que contiene el texto en maratí.
  • El método Ocr.Read() procesa la entrada y extrae el texto.
  • El texto reconocido se almacena en la variable AllText y se imprime en la consola.