Russian 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 geliştiricilerinin Rusça dahil olmak üzere 126 dildeki görüntü ve PDF belgelerinden metin okumalarına olanak tanıyan 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.Russian İçeriği

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

  • Rusça
  • RusçaBest
  • RusçaFast

İndir

Rusça Dil Paketi [русский язык]

Kurulum

Yapmamız gereken ilk şey, .NET projenize Rusça OCR paketini yüklemek.

Install-Package IronOcr.Languages.Russian

Kod Örneği

Bu C# kod örneği, bir Görüntü veya PDF belgesinden Rusça metnini okumaktadır.

// Import the IronOCR namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize IronTesseract, an OCR object
        var Ocr = new IronTesseract();

        // Set the OCR language to Russian
        Ocr.Language = OcrLanguage.Russian;

        // Create an OCR input for the Russian image
        using (var Input = new OcrInput(@"images\Russian.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOCR namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize IronTesseract, an OCR object
        var Ocr = new IronTesseract();

        // Set the OCR language to Russian
        Ocr.Language = OcrLanguage.Russian;

        // Create an OCR input for the Russian image
        using (var Input = new OcrInput(@"images\Russian.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Extract all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
' Import the IronOCR namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize IronTesseract, an OCR object
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Russian
		Ocr.Language = OcrLanguage.Russian

		' Create an OCR input for the Russian image
		Using Input = New OcrInput("images\Russian.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Extract all the recognized text
			Dim AllText = Result.Text

			' Output the recognized text
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • Yukarıdaki kod, gerekli IronOCR kütüphanesini içe aktarır ve OCR görevlerini gerçekleştirmek için kullanılan IronTesseract sınıfını başlatır.
  • Ocr.Language = OcrLanguage.Russian kullanarak OCR dilini Rusça olarak ayarlar.
  • Ardından, OcrInput sınıfını kullanarak belirtilen görüntü dosyasını Russian.png açar.
  • Ocr nesnesinin Read yöntemi, görüntüyü işlemek ve metni tanımak için kullanılır.
  • Son olarak, Result.Text içinden tanınan metni çıkarır ve çıktısını verir.