Danish OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

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 für .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 für .NET:

  • Dänisch
  • DanishBest
  • DanishFast
  • DanishFraktur

Download

Dänisches Sprachpaket style='white-space:default'>[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);
        }
    }
}
' 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

Dieses Beispiel zeigt, wie IronOCR eingerichtet wird, um dänischen Text aus einer Bilddatei zu lesen. Das IronTesseract-Objekt ist so konfiguriert, dass es die dänische Sprache verwendet, und ein Bild wird mit OcrInput geladen. Ocr.Read führt die OCR durch, und der erkannte Text wird extrahiert und ausgedruckt.