使用 C# 和 .NET 進行約魯巴語 OCR 識別
This article was translated from English: Does it need improvement?
TranslatedView the article in English
Other versions of this document:
IronOCR 是一個 C# 軟體元件,它允許 .NET 開發人員從圖像和 PDF 文件中讀取 126 種語言(包括約魯巴語)的文字。 它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Yoruba 的內容
此軟體包包含 43 種適用於 .NET 的 OCR 語言:
- 約魯巴語
- YorubaBest
- YorubaFast
下載
約魯巴語語言包[約魯巴語]
安裝
首要任務是將Yoruba OCR 套件安裝到您的 .NET 專案中。
Install-Package IronOCR.Languages.Yoruba
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取約魯巴語文字。
// 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 讀取約魯巴文本,方法是指定約魯巴語並處理圖像或 PDF 文件。





