Danish OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Autres versions de ce document :

IronOCR est un composant logiciel C# permettant aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont le danois.

Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET, et elle surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu de IronOcr.Langues.Danois

Ce package contient 61 langues OCR for .NET :

  • Danois
  • DanishBest
  • DanishFast
  • Fraktur danois

Télécharger

Pack de langue danoise [danois]

  • Télécharger au format ZIP
  • Installer avec NuGet

Installation

La première étape consiste à installer le package OCR danois dans votre projet .NET.

Install-Package IronOcr.Languages.Danish

Exemple de code

Cet exemple de code C# lit du texte danois à partir d'une image ou d'un document PDF à l'aide d'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

Cet exemple montre comment configurer IronOCR pour lire du texte danois à partir d'un fichier image. L'objet IronTesseract est configuré pour utiliser la langue danoise, et une image est chargée avec OcrInput. Ocr.Read effectue la reconnaissance optique de caractères (OCR), et le texte reconnu est extrait et imprimé.