Marathi OCR in C# and .NET

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

IronOCR ist eine C#-Softwarekomponente, die es .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Marathi, zu lesen.

Es ist ein erweiterter Fork von Tesseract, der ausschließlich for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.

Inhalt von IronOcr.Languages.Marathi

Dieses Paket enthält 46 OCR-Sprachen for .NET:

  • Marathi
  • MarathiBest
  • MarathiFast

Download

Marathi-Sprachpaket [मराठी]

Installation

Das erste, was wir tun müssen, ist unser Marathi OCR-Paket zu Ihrem .NET-Projekt zu installieren.

Install-Package IronOcr.Languages.Marathi

Beispielcode

Dieses C#-Code-Beispiel liest Marathi-Text aus einem Bild oder PDF-Dokument.

// Include the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the OCR engine
        var Ocr = new IronTesseract();

        // Specify the language as Marathi
        Ocr.Language = OcrLanguage.Marathi;

        // Load the image or PDF document to be processed
        using (var Input = new OcrInput(@"images\Marathi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Get the recognized text
            var AllText = Result.Text;

            // Output the recognized text to console
            Console.WriteLine(AllText);
        }
    }
}
// Include the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the OCR engine
        var Ocr = new IronTesseract();

        // Specify the language as Marathi
        Ocr.Language = OcrLanguage.Marathi;

        // Load the image or PDF document to be processed
        using (var Input = new OcrInput(@"images\Marathi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Get the recognized text
            var AllText = Result.Text;

            // Output the recognized text to console
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

Erklärung:

  • Dieser Code verwendet die Klasse IronTesseract aus der Bibliothek IronOCR zur OCR-Operation.
  • Die Eigenschaft Ocr.Language ist so eingestellt, dass das Marathi-Sprachpaket verwendet wird.
  • Ein OcrInput wird unter Verwendung des Pfads zu dem Bild oder der PDF-Datei, die den Marathi-Text enthält, erstellt. Die Methode Ocr.Read() verarbeitet die Eingabe und extrahiert den Text. Der erkannte Text wird in der Variable AllText gespeichert und auf der Konsole ausgegeben.