German OCR in C# and .NET
Andere Versionen dieses Dokuments:
IronOCR ist eine C#-Softwarekomponente, die es .NET-Programmierern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Deutsch, auszulesen.
Es ist eine erweiterte Abspaltung von Tesseract, die exklusiv for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.
Inhalt von IronOcr.Languages.German
Dieses Paket enthält 61 OCR-Sprachen for .NET:
- Deutsch
- DeutschBest
- DeutschFast
- DeutschFraktur
Download
Deutsches Sprachpaket [Deutsch]
Installation
Das Erste, was wir tun müssen, ist, unser deutsches OCR-Paket in Ihr .NET-Projekt zu installieren.
Install-Package IronOcr.Languages.German
Beispielcode
Dieses C#-Beispiel liest deutschen Text aus einem Bild oder PDF-Dokument.
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to German. This must match the language of the document you are scanning.
Ocr.Language = OcrLanguage.German;
using (var Input = new OcrInput(@"images\German.png"))
{
// Perform OCR on the provided image and get the result.
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result.
var AllText = Result.Text;
// Optionally, output the recognized text to the console for verification.
Console.WriteLine(AllText);
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to German. This must match the language of the document you are scanning.
Ocr.Language = OcrLanguage.German;
using (var Input = new OcrInput(@"images\German.png"))
{
// Perform OCR on the provided image and get the result.
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result.
var AllText = Result.Text;
// Optionally, output the recognized text to the console for verification.
Console.WriteLine(AllText);
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the OCR language to German. This must match the language of the document you are scanning.
Ocr.Language = OcrLanguage.German
Using Input = New OcrInput("images\German.png")
' Perform OCR on the provided image and get the result.
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the OCR result.
Dim AllText = Result.Text
' Optionally, output the recognized text to the console for verification.
Console.WriteLine(AllText)
End Using
In diesem Beispiel ist IronTesseract so konfiguriert, dass für die OCR die deutsche Sprache verwendet wird, was für die Verarbeitung von Bildern oder PDFs mit deutschem Text erforderlich ist. Die Klasse OcrInput dient zur Angabe der Bilddatei, und die Methode Read führt die OCR-Operation durch und gibt den extrahierten Text zurück.

