Marathi OCR in C# and .NET
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);
}
}
}
' Include the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize the OCR engine
Dim Ocr = New IronTesseract()
' Specify the language as Marathi
Ocr.Language = OcrLanguage.Marathi
' Load the image or PDF document to be processed
Using Input = New OcrInput("images\Marathi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Get the recognized text
Dim AllText = Result.Text
' Output the recognized text to console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Erklärung:
- Dieser Code verwendet die Klasse
IronTesseractaus der BibliothekIronOCRzur OCR-Operation. - Die Eigenschaft
Ocr.Languageist so eingestellt, dass das Marathi-Sprachpaket verwendet wird. - Ein
OcrInputwird unter Verwendung des Pfads zu dem Bild oder der PDF-Datei, die den Marathi-Text enthält, erstellt. Die MethodeOcr.Read()verarbeitet die Eingabe und extrahiert den Text. Der erkannte Text wird in der VariableAllTextgespeichert und auf der Konsole ausgegeben.

