Divehi OCR in C# and .NET
IronOCR ist eine C# Softwarekomponente, die es .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Divehi, zu lesen.
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.Divehi
Dieses Paket enthält 43 OCR-Sprachen for .NET:
- Divehi
- DivehiBest
- DivehiFast
Download
Divehi-Sprachpaket [ދވހ]
Installation
Das Erste, was wir tun müssen, ist das Divehi OCR-Paket in Ihr .NET-Projekt zu installieren.
Install-Package IronOcr.Languages.Divehi
Beispielcode
Dieses C# Codebeispiel liest Divehi-Text aus einem Bild oder PDF-Dokument.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi
' Load the image or PDF document into the OCR processor
Using Input = New OcrInput("images\Divehi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Erklärung
- Importieren von IronOcr: Das Beispiel beginnt mit dem Import des notwendigen IronOcr-Namespace.
- OCR-Engine wird erstellt : Es wird eine Instanz von
IronTesseract, der OCR-Engine, erstellt. - Festlegen der Sprache: Die Sprache für die OCR-Verarbeitung wird auf Divehi gesetzt, um eine genaue Erkennung speziell für diese Sprache zu gewährleisten.
- Eingabe wird geladen : Ein Bild oder ein PDF-Dokument wird mit
OcrInputgeöffnet und ist bereit zur Textextraktion. - OCR-Ausführung : Die Methode
Readverarbeitet die Eingabe und extrahiert den Text. - Textextraktion : Der erkannte Text wird in
AllTextgespeichert und auf der Konsole ausgegeben.
Dieser Code zeigt eine einfache, aber leistungsstarke Möglichkeit, IronOCR zu nutzen, um Divehi-Schrift aus digitalen Dokumenten zu lesen.

