OCR de sánscrito en C# y .NET

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

126 idiomas más

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

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

Este paquete contiene 49 idiomas OCR para .NET:

  • Sánscrito
  • SánscritoBest
  • SánscritoFast

Descargar

Paquete de idiomas de sánscrito [ससकतम]

Instalación

El primer paso es instalar el paquete OCR de sánscrito en tu proyecto .NET.

Install-Package IronOCR.Languages.Sanskrit

Ejemplo de código

Este ejemplo de código en C# lee texto en sánscrito de una imagen o documento PDF.

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract for OCR operations
        var Ocr = new IronTesseract
        {
            // Set the OCR language to Sanskrit
            Language = OcrLanguage.Sanskrit
        };

        // Define the input image or PDF file containing Sanskrit text
        using (var Input = new OcrInput(@"images\Sanskrit.png"))
        {
            // Perform OCR to read the text from the Input
            var Result = Ocr.Read(Input);

            // Capture the extracted text
            var AllText = Result.Text;

            // Print the extracted text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract for OCR operations
        var Ocr = new IronTesseract
        {
            // Set the OCR language to Sanskrit
            Language = OcrLanguage.Sanskrit
        };

        // Define the input image or PDF file containing Sanskrit text
        using (var Input = new OcrInput(@"images\Sanskrit.png"))
        {
            // Perform OCR to read the text from the Input
            var Result = Ocr.Read(Input);

            // Capture the extracted text
            var AllText = Result.Text;

            // Print the extracted text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create an instance of IronTesseract for OCR operations
		Dim Ocr = New IronTesseract With {.Language = OcrLanguage.Sanskrit}

		' Define the input image or PDF file containing Sanskrit text
		Using Input = New OcrInput("images\Sanskrit.png")
			' Perform OCR to read the text from the Input
			Dim Result = Ocr.Read(Input)

			' Capture the extracted text
			Dim AllText = Result.Text

			' Print the extracted text to the console
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Este ejemplo demuestra cómo configurar IronTesseract para realizar OCR en una imagen o PDF en sánscrito.
  • El método Ocr.Read() procesa la entrada y extrae el contenido de texto, el cual es accesible a través de la propiedad Result.Text.