Danish OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Andere Versionen dieses Dokuments:

IronOCR ist eine C#-Softwarekomponente, die .NET-Programmierern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Dänisch, zu lesen.

Es ist ein fortschrittlicher Fork von Tesseract, der ausschließlich for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Geschwindigkeit als auch Genauigkeit übertrifft.

Inhalt von IronOcr.Languages.Danish

Dieses Paket enthält 61 OCR-Sprachen for .NET:

  • Dänisch
  • DanishBest
  • DanishFast
  • DanishFraktur

Download

Dänisches Sprachpaket [dansk]

Installation

Der erste Schritt ist, das Dänische OCR-Paket in Ihr .NET-Projekt zu installieren.

Install-Package IronOcr.Languages.Danish

Beispielcode

Dieses C#-Codebeispiel liest dänischen Text aus einem Bild oder PDF-Dokument mit 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

Dieses Beispiel zeigt, wie man IronOCR einrichtet, um dänischen Text aus einer Bilddatei zu lesen. Das Objekt IronTesseract ist für die Verwendung der dänischen Sprache konfiguriert, und ein Bild mit OcrInput wird geladen. Ocr.Read führt die OCR durch, und der erkannte Text wird extrahiert und gedruckt.