Marathi OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Bu belgenin diğer versiyonları:

IronOCR, .NET kodlayıcılarının 126 dilde, Marathi dahil olmak üzere, resimlerden ve PDF belgelerinden metin okumasını sağlayan bir C# yazılım bileşenidir.

Bu, .NET geliştiricileri için özel olarak oluşturulmuş Tesseract'ın gelişmiş bir çatısıdır ve hem hız hem de doğruluk açısından diğer Tesseract motorlarını düzenli olarak geride bırakır.

IronOcr.Languages.Marathi İçeriği

Bu paket, .NET için 46 OCR dilini içerir:

  • Marathi
  • MarathiBest
  • MarathiHızlı

İndir

Marathi Dil Paketi [मराठी]

Kurulum

Marathi OCR paketimizi .NET projenize kurmamız gereken ilk şeydir.

Install-Package IronOcr.Languages.Marathi

Kod Örneği

Bu C# kod örneği, bir Resim veya PDF belgesinden Marathi metin okumaktadır.

// 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
$vbLabelText   $csharpLabel

Açıklama:

  • Bu kod, OCR işlemini gerçekleştirmek için IronOCR kütüphanesindeki IronTesseract sınıfını kullanır.
  • Ocr.Language özelliği, Marathi dil paketini kullanacak şekilde ayarlanmıştır.
  • OcrInput, Marathi metnini içeren resmin veya PDF'nin yolu kullanılarak oluşturulur.
  • Ocr.Read() yöntemi, girişi işler ve metni çıkarır.
  • Tanınan metin AllText değişkeninde saklanır ve konsola PRINT edilir.