C# ve .NET'te Tayca Alfabe OCR
Bu belgenin diğer versiyonları:
IronOCR, Tay Alfabesi dahil olmak üzere 126 dilde resimlerden ve PDF belgelerinden metin okuyan 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.Thai İçeği
Bu paket, .NET için 96 OCR dili içerir:
- Tayca
- TaycaBest
- TaycaFast
- Tayca Alfabe
- Tayca AlfabeBest
- TayAlfabesiHızlı
İndir
Tay Alfabesi Dil Paketi [ไทย]
Kurulum
İlk yapmamız gereken şey, .NET projenize Tay Alfabesi OCR paketimizi yüklemek.
Install-Package IronOcr.Languages.Thai
Kod Örneği
Bu C# kod örneği, bir resim veya PDF belgesinden Tay Alfabesi metni okur.
// Ensure you have installed the IronOcr.Languages.Thai package via NuGet.
// Import the IronOcr namespace to work with IronOCR classes.
using IronOcr;
class ThaiOcrExample
{
static void Main()
{
// Create a new instance of IronTesseract for OCR processing
var ocr = new IronTesseract();
// Set the language to Thai for Optical Character Recognition
ocr.Language = OcrLanguage.Thai;
// Using the 'using' statement ensures that resources are properly disposed.
using (var input = new OcrInput(@"images\Thai.png"))
{
// Perform OCR to read the text from the input image
var result = ocr.Read(input);
// Retrieve and store all recognized text from the image
string allText = result.Text;
// Optionally, you can output the text to console or log it as needed
System.Console.WriteLine(allText);
}
}
}
// Ensure you have installed the IronOcr.Languages.Thai package via NuGet.
// Import the IronOcr namespace to work with IronOCR classes.
using IronOcr;
class ThaiOcrExample
{
static void Main()
{
// Create a new instance of IronTesseract for OCR processing
var ocr = new IronTesseract();
// Set the language to Thai for Optical Character Recognition
ocr.Language = OcrLanguage.Thai;
// Using the 'using' statement ensures that resources are properly disposed.
using (var input = new OcrInput(@"images\Thai.png"))
{
// Perform OCR to read the text from the input image
var result = ocr.Read(input);
// Retrieve and store all recognized text from the image
string allText = result.Text;
// Optionally, you can output the text to console or log it as needed
System.Console.WriteLine(allText);
}
}
}
Imports IronOcr
Class ThaiOcrExample
Shared Sub Main()
' Create a new instance of IronTesseract for OCR processing
Dim ocr As New IronTesseract()
' Set the language to Thai for Optical Character Recognition
ocr.Language = OcrLanguage.Thai
' Using the 'Using' statement ensures that resources are properly disposed.
Using input As New OcrInput("images\Thai.png")
' Perform OCR to read the text from the input image
Dim result = ocr.Read(input)
' Retrieve and store all recognized text from the image
Dim allText As String = result.Text
' Optionally, you can output the text to console or log it as needed
System.Console.WriteLine(allText)
End Using
End Sub
End Class
Bu örnekte, images klasöründe bulunan Thai.png adlı bir görüntüden Tayca metni okuyoruz. Dosya yolunu kendi resim konumunuzla değiştirdiğinizden emin olun. OCR dili, tanıma için Tayca dil paketini belirtmek üzere OcrLanguage.Thai kullanılarak Tayca olarak ayarlanmıştır.

