Divehi OCR in C# and .NET

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

126 Daha Fazla Dil

IronOCR, .NET kodlayıcılarının Divehi dahil olmak üzere 126 dildeki metinleri görüntülerden ve PDF belgelerinden okumasına olanak tanıyan bir C# yazılım bileşenidir.

Tesseract'ın ileri düzey bir çatallamasıdır, yalnızca .NET geliştiricileri için oluşturulmuş olup hız ve doğruluk açısından diğer Tesseract motorlarını düzenli olarak geride bırakmaktadır.

IronOcr.Languages.Divehi'nin İçeriği

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

  • Divehi
  • DivehiBest
  • DivehiFast

İndirme

Divehi Dil Paketi [ދވހ]

Kurulum

Yapmamız gereken ilk şey, Divehi OCR paketimizi .NET projenize yüklemektir.

Install-Package IronOcr.Languages.Divehi

Kod Örneği

Bu C# kod örneği, bir Görüntü veya PDF belgesinden Divehi metnini okur.

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

Açıklama

  • IronOcr'ı İçe Aktarma: Örnek, gerekli IronOcr ad alanını içe aktararak başlar.
  • OCR Motoru Oluşturma: OCR motorunun bir örneği, IronTesseract ile oluşturulur.
  • Dili Belirtme: OCR işlemi için dil Divehi'ye ayarlanır, bu dil için doğru tanıma sağlanır.
  • Girdi Yükleme: Metin çıkarımı için hazır olarak, bir resim veya PDF belgesi OcrInput kullanılarak açılır.
  • OCR Uygulama: Read metodu girdiyi işler ve metni çıkarır.
  • Metin Çıkarma: Tanınan metin AllText içinde saklanır ve konsola yazdırılır.

Bu kod, dijital belgelerden Divehi yazısını okumak için IronOCR'dan basit ama güçlü bir şekilde yararlanmanın bir yolunu sergiler.