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 Swahili de dahil olmak üzere 126 dildeki görüntülerden ve PDF belgelerinden metin okumalarını sağlayan bir C# yazılım bileşenidir. Tesseract'ın, yalnızca .NET geliştiricileri için özel olarak oluşturulmuş gelişmiş bir dalıdır ve hız ve doğruluk açısı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 dilini içerir:

  • Svahili
  • SvahiliBest
  • SvahiliFast

İndir

Swahili Dil Paketi [Kiswahili]

Kurulum

İlk adım, .NET projenize Swahili OCR paketini yüklemektir.

Install-Package IronOcr.Languages.Swahili

Kod Örneği

Bu C# kod örneği, bir Görüntü veya PDF belgesinden Swahili metni okur.

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. Using IronOCR Ad Alanı: OCR işlemleri için sınıflar ve yöntemler sağlayan IronOcr ad alanını dahil ediyoruz.

  2. OCR Motorunu Başlatma: OCR motoru olan IronTesseract'nin bir örneğini oluşturuyoruz. Dilini Svahili olarak ayarlamak, Svahili metinleri tanımasını sağlar.

  3. OCR Girişi: OcrInput sınıfı, metni çıkarmak istediğimiz dosyayı (görüntü veya PDF) belirtmek için kullanılır.

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

  5. Çıktı: Tanınan metin, gerektiğinde kullanılabilecek AllText içinde saklanır. Bu örnekte, göstermek amacıyla konsola yazdırılır.