OCR del alfabeto cirílico en C

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 C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el alfabeto cirílico.

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

Este paquete contiene 73 idiomas OCR para .NET:

  • Alfabetocírilico
  • AlfabetocírilicoMejor
  • AlfabetocírilicoRápido

Descargar

Paquete de idioma del alfabeto cirílico [Guiones cirílicos]

Instalación

Lo primero que tienes que hacer es instalar el paquete OCR Alfabetocírilico en tu proyecto .NET.

Install-Package IronOCR.Languages.Cyrillic

Ejemplo de código

Este ejemplo de código C# lee texto del alfabeto cirílico de una imagen o documento PDF.

using IronOcr;

public class OcrExample
{
    public void ReadCyrillicText()
    {
        // Initialize a new instance of the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR engine to use the Cyrillic language package
        Ocr.Language = OcrLanguage.Cyrillic;

        // Create a new OCR input from an image file
        using (var Input = new OcrInput(@"images\Cyrillic.png"))
        {
            // Read the image using the OCR engine
            var Result = Ocr.Read(Input);

            // Retrieve Recognized Text
            var AllText = Result.Text;

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
using IronOcr;

public class OcrExample
{
    public void ReadCyrillicText()
    {
        // Initialize a new instance of the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR engine to use the Cyrillic language package
        Ocr.Language = OcrLanguage.Cyrillic;

        // Create a new OCR input from an image file
        using (var Input = new OcrInput(@"images\Cyrillic.png"))
        {
            // Read the image using the OCR engine
            var Result = Ocr.Read(Input);

            // Retrieve Recognized Text
            var AllText = Result.Text;

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
Imports IronOcr

Public Class OcrExample
	Public Sub ReadCyrillicText()
		' Initialize a new instance of the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Set the OCR engine to use the Cyrillic language package
		Ocr.Language = OcrLanguage.Cyrillic

		' Create a new OCR input from an image file
		Using Input = New OcrInput("images\Cyrillic.png")
			' Read the image using the OCR engine
			Dim Result = Ocr.Read(Input)

			' Retrieve Recognized Text
			Dim AllText = Result.Text

			' Output the recognized text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • IronTesseract: Esta es la clase del motor OCR que se utiliza para configurar y ejecutar tareas de OCR.
  • OcrInput: Una clase que representa la imagen o documento de entrada sobre el cual deseas realizar OCR.
  • OcrLanguage.Cyrillic: Especifica que el motor OCR debe usar el paquete de idioma cirílico para el reconocimiento.
  • Result.Text: Accede al texto reconocido del objeto resultado de OCR.

Este ejemplo demuestra un caso de uso simple donde se procesa una imagen con texto cirílico para extraer el texto.