Danish OCR in C# and .NET
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);
}
}
}
' 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
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.

