Welsh OCR in C# and .NET
Bu belgenin diğer versiyonları:
IronOCR, .NET kodlayıcılarının 126 dilde, Galce de dahil olmak üzere, resimlerden 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.Welsh'in İçeriği
Bu paket .NET için Galce OCR dilinin üç versiyonunu içerir:
- Welsh
- WelshBest
- WelshFast
İndirme
Galce Dil Paketi [Cymraeg]
Kurulum
İlk adım, .NET projenize Galce OCR paketini yüklemektir.
Install-Package IronOcr.Languages.Welsh
Kod Örneği
Bu C# kod örneği, bir resim veya PDF belgesinden Galce metin okumanın nasıl yapıldığını gösterir.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Welsh
Ocr.Language = OcrLanguage.Welsh;
// Read text from the given image
using (var Input = new OcrInput(@"images\Welsh.png"))
{
// Perform OCR and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Welsh
Ocr.Language = OcrLanguage.Welsh;
// Read text from the given image
using (var Input = new OcrInput(@"images\Welsh.png"))
{
// Perform OCR and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the language to Welsh
Ocr.Language = OcrLanguage.Welsh
' Read text from the given image
Using Input = New OcrInput("images\Welsh.png")
' Perform OCR and get the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Bu kodda:
- OCR işlevlerini kullanmak için
IronOcrisim alanını kullanarak başlıyoruz. - IronOCR tarafından sağlanan ana sınıf olan
IronTesseract'tan bir örnek oluşturuyoruz ve OCR işlemleri gerçekleştiriyoruz. - OCR dili
Ocr.Language = OcrLanguage.Welshkullanılarak Galce olarak ayarlanır. - OCR işleme için
imagesdizininde bulunanWelsh.pngadlı bir resim dosyasını açıyoruz. - Son olarak,
Ocr.Read(Input)yöntemi resimden metni okur ve çıkarılan metinAllTextiçinde saklanır. - Tanınan Galce metin daha sonra konsola yazdırılır.

