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, C# yazılım bileşeni olarak, .NET kodlayıcılarına Rusça dahil 126 dildeki görüntülerden ve PDF belgelerinden metin okuma imkanı tanır.

Sadece .NET geliştiricileri için inşa edilen Tesseract'ın gelişmiş bir dalı olup, hem hız hem de doğruluk açısından diğer Tesseract motorlarını sık sık geride bırakır.

IronOcr.Languages.Russian İçeriği

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

  • Rusça
  • RusçaEnIyi
  • RussianFast

İndirme

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

Kurulum

Yapmamız gereken ilk şey, Rusça OCR paketimizi .NET projenize kurmaktır.

Install-Package IronOcr.Languages.Russian

Kod Örneği

Bu C# kod örneği, bir Görüntüden veya PDF belgesinden Rusça metin okur.

// 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 kutuphanesini içe aktarır ve OCR görevlerini gerçekleştirmek için kullanılan IronTesseract sınıfını başlatır.
  • OCR için dili Ocr.Language = OcrLanguage.Russian kullanarak Rusça'ya ayarlar.
  • Sonrasında OcrInput sınıfını kullanarak belirtilen Russian.png resim dosyasını açar.
  • Resmi işlemek ve metni tanımak için Ocr nesnesinin Read yöntemi kullanılır,
  • Son olarak, Result.Text üzerinden tanınan metni çıkartır ve çıktısını alır.