OCR pastún 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 desarrolladores .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluyendo el pashto. Es una rama avanzada de Tesseract, construida exclusivamente para desarrolladores de .NET y supera regularmente a otros motores de Tesseract tanto en velocidad como en precisión.

Contenido de IronOcr.Languages.Pashto

Este paquete contiene 43 idiomas OCR para .NET:

  • Pashto
  • PashtoBest
  • PashtoFast

Descargar

Paquete de idioma pashto [پښتو]

Instalación

Lo primero que tenemos que hacer es instalar nuestro paquete OCR de Pashto en su proyecto .NET.

Install-Package IronOCR.Languages.Pashto

Ejemplo de código

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

// Import the IronOcr namespace
using IronOcr;

public class PashtoOcrExample
{
    public static void Main()
    {
        // Create an instance of the IronTesseract class
        var Ocr = new IronTesseract();

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

        // Specify the image file containing the Pashto text
        using (var Input = new OcrInput(@"images\Pashto.png"))
        {
            // Perform the OCR operation on the input image
            var Result = Ocr.Read(Input);

            // Store the extracted text from the image in a string variable
            var AllText = Result.Text;
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

public class PashtoOcrExample
{
    public static void Main()
    {
        // Create an instance of the IronTesseract class
        var Ocr = new IronTesseract();

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

        // Specify the image file containing the Pashto text
        using (var Input = new OcrInput(@"images\Pashto.png"))
        {
            // Perform the OCR operation on the input image
            var Result = Ocr.Read(Input);

            // Store the extracted text from the image in a string variable
            var AllText = Result.Text;
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Public Class PashtoOcrExample
	Public Shared Sub Main()
		' Create an instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

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

		' Specify the image file containing the Pashto text
		Using Input = New OcrInput("images\Pashto.png")
			' Perform the OCR operation on the input image
			Dim Result = Ocr.Read(Input)

			' Store the extracted text from the image in a string variable
			Dim AllText = Result.Text
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Este fragmento de código demuestra cómo utilizar la biblioteca IronOCR para reconocer texto en pashto.
  • Configura la clase IronTesseract, selecciona el pashto como idioma y procesa un archivo de imagen (Pashto.png) para extraer y mostrar el texto.