OCR panyabí 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 en C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluyendo el panjabi. 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.Panjabi

Este paquete contiene 46 idiomas OCR para .NET:

  • Panjabi
  • PanjabiBest
  • PanjabiFast

Descargar

Paquete de idioma panjabi [ਪਜਾਬੀ]

Instalación

Lo primero que debemos hacer es instalar el paquete OCR de Panjabi en tu proyecto .NET.

Install-Package IronOCR.Languages.Panjabi

Ejemplo de código

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

// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to Panjabi
        Ocr.Language = OcrLanguage.Panjabi;

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

            // Extract and store the recognized text from the OCR result
            var AllText = Result.Text;
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to Panjabi
        Ocr.Language = OcrLanguage.Panjabi;

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

            // Extract and store the recognized text from the OCR result
            var AllText = Result.Text;
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

		' Set the language to Panjabi
		Ocr.Language = OcrLanguage.Panjabi

		' Define the input image or PDF file
		Using Input = New OcrInput("images\Panjabi.png")
			' Perform OCR on the input file
			Dim Result = Ocr.Read(Input)

			' Extract and store the recognized text from the OCR result
			Dim AllText = Result.Text
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Explicación

  • IronTesseract: Esta es la clase principal proporcionada por IronOCR para las operaciones de OCR.
  • Ocr.Language: Especificamos qué idioma debería usar el motor OCR. Aquí, está configurado para panjabi.
  • OcrInput: Esta clase se utiliza para especificar el archivo de entrada (imagen o PDF) en el que se debe realizar el OCR.
  • Ocr.Read(): Este método realiza la tarea OCR actual y devuelve un resultado que contiene el texto extraído.
  • Result.Text: Esto contiene el texto extraído después de realizar OCR en el archivo de entrada.

Este ejemplo demuestra cómo usar efectivamente la biblioteca IronOCR para extraer texto en panjabi de imágenes o documentos PDF en una aplicación .NET.