OCR danois en C# et .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this 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 pour .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);
        }
    }
}
' Import the IronOcr namespace to access OCR functionalities
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize the IronTesseract object, which will handle OCR operations
		Dim 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 Input = New OcrInput("images\Danish.png")
			' Perform OCR on the input image and store the result
			Dim Result = Ocr.Read(Input)

			' Extract the recognized text from the result
			Dim AllText = Result.Text

			' Output the extracted text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$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), puis extrait et imprime le texte reconnu.