Tonga 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, C# ile yazılmış bir yazılım bileşenidir ve .NET geliştiricilerinin Tonga dahil olmak üzere 126 dilde resimlerden ve PDF belgelerinden metin okumasına olanak tanır. Bu, yalnızca .NET geliştiricileri için tasarlanmış ileri düzey bir Tesseract çatallaması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.Tonga'nın İçeriği

Bu paket, Tonga için özel olarak üç OCR dil modeli içerir:

  • Tonga
  • TongaBest
  • TongaFast

İndirme

Tonga Dil Paketi [faka Tonga]

  • Zip dosyası olarak indir Zip dosyası.
  • NuGet ile yükleyin NuGet.

Kurulum

Tonga OCR özelliklerini kullanmaya başlamak için, .NET projenize aşağıdaki NuGet komutunu kullanarak Tonga OCR paketini kurun:

Install-Package IronOcr.Languages.Tonga

Kod Örneği

Aşağıdaki C# kod örneği, IronOCR kullanarak bir görüntüden veya PDF belgesinden Tonga metni okumanın nasıl yapıldığını gösterir.

// Include the necessary IronOcr namespace
using IronOcr;

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

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
// Include the necessary IronOcr namespace
using IronOcr;

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

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
' Include the necessary IronOcr namespace
Imports IronOcr

Friend Class TongaOcrExample
	Shared Sub Main()
		' Initialize the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Set the OCR engine to use the Tonga language pack
		Ocr.Language = OcrLanguage.Tonga

		' Load the input image or PDF into OcrInput
		Using Input = New OcrInput("images\Tonga.png")
			' Perform OCR to read the text from the image
			Dim Result = Ocr.Read(Input)

			' Retrieve the full text recognition result
			Dim AllText = Result.Text

			' Output the result or process further as needed
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Bu kod örneği, IronTesseract OCR motorunu başlatmayı ve Tonga dilini kullanacak şekilde ayarlamayı gösterir.
  • Belirtilen yoldan bir resmi OcrInput nesnesine yüklüyoruz.
  • Ocr.Read() yöntemi, girdiyi işleyip metni çıkartır ve ardından tanınan metni Result.Text özelliği aracılığıyla alırız.
  • Son olarak, çıkarılan metin uygulamada ihtiyaça göre çıktı alınabilir veya işlenebilir.