Divehi OCR in C# and .NET

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

126 Weitere Sprachen

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);
        }
    }
}
$vbLabelText   $csharpLabel

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 OcrInput geöffnet und ist bereit zur Textextraktion.
  • OCR-Ausführung : Die Methode Read verarbeitet die Eingabe und extrahiert den Text.
  • Textextraktion : Der erkannte Text wird in AllText gespeichert 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.