Danish OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Otras versiones de este documento:

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

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

Contenido de IronOcr.Languages.Danish

Este paquete contiene 61 idiomas OCR for .NET:

  • Danés
  • DanésBest
  • DanésRápido
  • DanésFraktur

Descargar

Paquete de idioma danés [dansk]

Instalación

El primer paso es instalar el paquete OCR danés en tu proyecto .NET.

Install-Package IronOcr.Languages.Danish

Ejemplo de código

Este ejemplo de código en C# lee texto en danés de una imagen o documento PDF utilizando IronOCR.

// Import the IronOcr namespace to access OCR functionalities
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract object, which will handle OCR operations
        var Ocr = new IronTesseract();

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

        // Using a 'using' statement to ensure the OcrInput object is disposed of correctly
        using (var Input = new OcrInput(@"images\Danish.png"))
        {
            // Perform OCR on the input image and store the result
            var Result = Ocr.Read(Input);

            // Extract the recognized text from the result
            var AllText = Result.Text;

            // Output the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to access OCR functionalities
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract object, which will handle OCR operations
        var Ocr = new IronTesseract();

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

        // Using a 'using' statement to ensure the OcrInput object is disposed of correctly
        using (var Input = new OcrInput(@"images\Danish.png"))
        {
            // Perform OCR on the input image and store the result
            var Result = Ocr.Read(Input);

            // Extract the recognized text from the result
            var AllText = Result.Text;

            // Output the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

Este ejemplo muestra cómo configurar IronOCR para leer texto en danés desde un archivo de imagen. El objeto IronTesseract está configurado para usar el idioma danés y se carga una imagen con OcrInput. Ocr.Read realiza el OCR y se extrae e imprime el texto reconocido.