Italian 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 programcılarının İtalyanca dahil olmak üzere 126 dildeki resimlerden ve PDF belgelerinden metin okumasını sağlayan 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.Italian İçeriği

Bu paket, .NET için 6 OCR dil modu içerir:

  • İtalyanca
  • ItalianBest
  • ItalianFast
  • ItalianOld
  • ItalianOldBest
  • ItalianOldFast

İndirme

İtalyanca Dil Paketi [italiano]

Kurulum

İlk yapmamız gereken şey İtalyanca OCR paketimizi .NET projenize yüklemektir.

Install-Package IronOcr.Languages.Italian

Kod Örneği

Bu C# kod örneği, bir resim veya PDF belgesinden İtalyanca metin okur.

// Include IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

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

        // Read text from an image file
        using (var Input = new OcrInput(@"images\Italian.png"))
        {
            // Perform OCR to get the text content from the image
            var Result = Ocr.Read(Input);

            // Get and print all the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
// Include IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

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

        // Read text from an image file
        using (var Input = new OcrInput(@"images\Italian.png"))
        {
            // Perform OCR to get the text content from the image
            var Result = Ocr.Read(Input);

            // Get and print all the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
' Include IronOcr library
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

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

		' Read text from an image file
		Using Input = New OcrInput("images\Italian.png")
			' Perform OCR to get the text content from the image
			Dim Result = Ocr.Read(Input)

			' Get and print all the recognized text
			Dim AllText = Result.Text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Açıklama:

  1. IronOCR Kullanarak: IronOcr kutuphanesi, OCR yeteneklerini kullanmak icin dahildir.
  2. Bir IronTesseract Cinstance'i Oluşturmak: IronTesseract, OCR işleme icin kullanan temel bir siniftir.
  3. Dili Ayarlama: OCR, Ocr.Language = OcrLanguage.Italian kullanarak Italyanca dili işlemek icin ayarlanir.
  4. Girdiyi Okuma: Bir OcrInput nesnesi, resim dosyasini belirtmek icin oluşturulur.
  5. OCR Basarimi: Ocr.Read(Input), giris resmi uzerinde OCR işlemini gerceklestirir ve metin sonucunu dondurur.
  6. Çikari: Ortaya cikani metin AllText depolanir ve konsolda görüntülenir.

Ornegin duzgun calismasi icin images\Italian.png dosya yolunun dogru oldugundan ve dosyanin mevcut oldugundan emin olun.