Sinhala OCR in C# and .NET
Bu belgenin diğer versiyonları:
IronOCR, .NET kodlayıcıların Sinhala da 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.Sinhala İçeriği
Bu paket, .NET için 114 OCR dili içerir:
- Sinhala
- SinhalaBest
- SinhalaFast
- SinhalaAlphabet
- SinhalaAlphabetBest
- SinhalaAlphabetFast
İndir
Sinhala Dil Paketi [सංහල]
Kurulum
İlk adım, .NET projenize Sinhala OCR paketini yüklemektir.
Install-Package IronOcr.Languages.Sinhala
Kod Örneği
Bu C# kod örneği, bir Görüntü veya PDF belgesinden Sinhala metni 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ıdır.
- Language: Tanınacak metnin dilini belirtir; bu durumda Sinhala.
- OcrInput: Metin tanımanın gerçekleştirilmesi gereken girdi dosyasını (görüntü veya PDF) temsil eder.
- Read: Girdi dosyası üzerinde OCR işlemini yürütür ve tanınan metni döndürür.
- Result.Text: Girdi dosyasının OCR ile tanınan metnini içerir ve daha fazla işlem veya görüntüleme için kullanılabilir.

