Sinhala OCR in C# and .NET
Bu belgenin diğer versiyonları:
IronOCR, .NET kodlayıcılarının Sinhala dahil 126 dili içeren görüntülerden ve PDF belgelerinden metin okumalarına olanak tanıyan 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.Sinhala içeriği
Bu paket, .NET için 114 OCR dilini içerir:
- Sinhala
- SinhalaBest
- SinhalaFast
- SinhalaAlphabet
- SinhalaAlphabetBest
- SinhalaAlphabetFast
İndirme
Sinhala Dil Paketi [සංහල]
Kurulum
Yapmamız gereken ilk şey, .NET projenize Sinhala OCR paketini kurmaktır.
Install-Package IronOcr.Languages.Sinhala
Kod Örneği
Bu C# kod örneği, bir Görüntüden veya PDF belgesinden Sinhala metin okur.
// Import the IronOcr namespace
using IronOcr;
class SinhalaOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine to use the Sinhala language
Ocr.Language = OcrLanguage.Sinhala;
// Define the input image or PDF file
using (var Input = new OcrInput(@"images\Sinhala.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class SinhalaOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine to use the Sinhala language
Ocr.Language = OcrLanguage.Sinhala;
// Define the input image or PDF file
using (var Input = new OcrInput(@"images\Sinhala.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class SinhalaOcrExample
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR engine to use the Sinhala language
Ocr.Language = OcrLanguage.Sinhala
' Define the input image or PDF file
Using Input = New OcrInput("images\Sinhala.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Class
Açıklama:
- IronTesseract: Metin tanıma için kullanılan ana OCR motoru sınıfı.
- Dil: Tanınacak metnin dilini belirtir; Bu durumda, Sinhala.
- OcrInput: Metin tanımanın gerçekleştirilmesi gereken giriş dosyasını (görüntü veya PDF) temsil eder.
- Read: Giriş dosyasında OCR işlemini yürütür ve tanınan metni döndürür.
- Result.Text: Giriş dosyasından OCR ile tanınan metni içerir, bu metin daha fazla işlem veya gösterim için kullanılabilir.

