Swahili 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 kodlayıcılarının Swahili dahil olmak üzere 126 dilde görüntüler ve PDF belgelerinden metin okumasını sağlayan bir C# yazılım bileşenidir. Tesseract'ın geliştirilmiş bir dalıdır, yalnızca .NET geliştiricileri için geliştirilmiştir ve hem hız hem de doğruluk bakımından diğer Tesseract motorlarını düzenli olarak geride bırakır.

IronOcr.Languages.Swahili İçeriği

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

  • Swahili
  • SwahiliBest
  • SwahiliFast

İndirme

Swahili Dil Paketi [Kiswahili]

Kurulum

Yapmamız gereken ilk şey, Swahili OCR paketimizi .NET projenize yüklemektir.

Install-Package IronOcr.Languages.Swahili

Kod Örneği

Bu C# kod örneği, bir görüntü veya PDF belgesinden Swahili metin okumayı gösterir.

using IronOcr;

var Ocr = new IronTesseract();

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

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

    // Retrieve the recognized text
    var AllText = Result.Text;

    // Output the recognized text to the console (optional)
    Console.WriteLine(AllText);
}
using IronOcr;

var Ocr = new IronTesseract();

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

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

    // Retrieve the recognized text
    var AllText = Result.Text;

    // Output the recognized text to the console (optional)
    Console.WriteLine(AllText);
}
Imports IronOcr

Private Ocr = New IronTesseract()

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

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

	' Retrieve the recognized text
	Dim AllText = Result.Text

	' Output the recognized text to the console (optional)
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Açıklama:

  1. IronOcr Namespace Kullanımı: OCR işlemleri için sınıflar ve yöntemler sağlayan IronOcr alan adını içeriyoruz.

  2. OCR Motorunu Başlat: OCR motoru olan IronTesseract örneğini oluşturuyoruz. Dilini Swahili olarak ayarlamak, Swahili metni tanımasını sağlar.

  3. OCR Girişi: Hangi dosyadan (görüntü veya PDF) metin çıkarmak istediğimizi belirtmek için OcrInput sınıfı kullanılır.

  4. OCR Okuma: Read yöntemi girdiyi işler ve tanınan metni içeren bir OcrResult nesnesi döndürür.

  5. Çıktı: Tanınan metin, ihtiyaç duyulduğunda kullanılabilecek olan AllText içine kaydedilir. Bu örnekte, gösterim amacıyla konsola yazdırılır.