Yoruba OCR in C# and .NET
This article was translated from English: Does it need improvement?
Translated
View the article in English
此文件的其他版本:
IronOCR 是一個 C# 的軟體組件,允許 .NET 開發者從圖像和 PDF 文件中讀取 126 種語言的文字,包括 Yoruba。 它是 Tesseract 的高級分支,專為 .NET 開發者打造,並且在速度和準確性上經常超越其他 Tesseract 引擎。
IronOcr.Languages.Yoruba 的內容
此套件包含43種適用於.NET的OCR語言:
- Yoruba
- YorubaBest
- YorubaFast
下載
Yoruba 語言包 [Yorùbá]
安裝
第一個任務是將 Yoruba OCR 套件安裝到您的 .NET 專案中。
Install-Package IronOcr.Languages.Yoruba
程式碼範例
這個 C# 範例程式碼從圖像或 PDF 文件中讀取 Yoruba 文字。
// Remember to install the package first:
// PM> Install-Package IronOcr.Languages.Yoruba
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Yoruba
Ocr.Language = OcrLanguage.Yoruba;
// Specify the image or PDF file to read
using (var Input = new OcrInput(@"images\Yoruba.png"))
{
// Perform OCR on the input file
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine("Recognized Text: ");
Console.WriteLine(AllText);
}
}
}
// Remember to install the package first:
// PM> Install-Package IronOcr.Languages.Yoruba
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Yoruba
Ocr.Language = OcrLanguage.Yoruba;
// Specify the image or PDF file to read
using (var Input = new OcrInput(@"images\Yoruba.png"))
{
// Perform OCR on the input file
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine("Recognized Text: ");
Console.WriteLine(AllText);
}
}
}
' Remember to install the package first:
' PM> Install-Package IronOcr.Languages.Yoruba
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR language to Yoruba
Ocr.Language = OcrLanguage.Yoruba
' Specify the image or PDF file to read
Using Input = New OcrInput("images\Yoruba.png")
' Perform OCR on the input file
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine("Recognized Text: ")
Console.WriteLine(AllText)
End Using
End Sub
End Class
$vbLabelText
$csharpLabel
程式碼中的註釋解釋每個步驟,從設置語言到提取和列印識別出的文字。 此範例專注於使用 IronOCR 讀取 Yoruba 文字,方法是指定 Yoruba 語言並處理圖像或 PDF 文件。

