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, Tonga dahil olmak üzere 126 dilde resimlerden ve PDF belgelerinden metin okuyan bir C# yazılım bileşenidir. Bu, .NET geliştiricileri için özel olarak hazırlanmış Tesseract'ın gelişmiş bir çatalı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 İçeği

Bu paket, Tonga'ya özel üç OCR dil modeli içerir:

  • Tonga
  • TongaEn İyi
  • TongaHızlı

İndir

Tonga Dil Paketi [faka Tonga]

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

Kurulum

Tonga OCR kullanmaya başlamak için, şu NuGet komutunu kullanarak Tonga OCR paketini .NET projenize yükleyin:

Install-Package IronOcr.Languages.Tonga

Kod Örneği

Aşağıdaki C# kod örneği, IronOCR kullanarak bir resim veya PDF belgesinden Tonga metni okuma işlemini 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 görüntüyü OcrInput nesnesine yükleriz.
  • Ocr.Read() yöntemi, metni çıkarmak için girişi işler ve ardından Result.Text özelliği aracılığıyla tanınan metni alırız.
  • Son olarak, çıkarılan metin uygulamada gerektiği gibi çıktı alabilir veya işlenebilir.