Cebuano OCR in C
IronOCR 是一款 C# 軟體元件,讓 .NET 程式設計師能夠從 126 種語言(包括宿務語)的圖片和 PDF 文件中讀取文字。它是 Tesseract 的進階分支版本,專為 .NET 開發者打造,無論在速度或準確度方面,其表現通常都優於其他 Tesseract 引擎。
IronOcr.Languages.Cebuano 的內容
此套件包含 46 種適用於 .NET 的 OCR 語言:
- 宿務語
- 宿務語Best
- 宿務語Fast
下載
宿務語語言套件 [Bisaya]
安裝
我們首先必須將 Cebuano OCR 套件安裝至您的 .NET 專案中。
Install-Package IronOcr.Languages.Cebuano
程式碼範例
此 C# 程式碼範例用於從圖片或 PDF 文件中讀取宿務語文字。
// Install the IronOCR Cebuano language package via NuGet package manager
// PM> Install-Package IronOcr.Languages.Cebuano
using IronOcr;
class Program
{
static void Main()
{
// Instantiate an IronTesseract object
var Ocr = new IronTesseract();
// Set the OCR language to Cebuano
Ocr.Language = OcrLanguage.Cebuano;
// Define the input source containing the image or PDF with Cebuano text
using (var Input = new OcrInput(@"images\Cebuano.png"))
{
// Perform OCR to read the text from the input source
var Result = Ocr.Read(Input);
// Extract and display the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}
// Install the IronOCR Cebuano language package via NuGet package manager
// PM> Install-Package IronOcr.Languages.Cebuano
using IronOcr;
class Program
{
static void Main()
{
// Instantiate an IronTesseract object
var Ocr = new IronTesseract();
// Set the OCR language to Cebuano
Ocr.Language = OcrLanguage.Cebuano;
// Define the input source containing the image or PDF with Cebuano text
using (var Input = new OcrInput(@"images\Cebuano.png"))
{
// Perform OCR to read the text from the input source
var Result = Ocr.Read(Input);
// Extract and display the recognized text
var AllText = Result.Text;
Console.WriteLine(AllText);
}
}
}
' Install the IronOCR Cebuano language package via NuGet package manager
' PM> Install-Package IronOcr.Languages.Cebuano
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Instantiate an IronTesseract object
Dim Ocr = New IronTesseract()
' Set the OCR language to Cebuano
Ocr.Language = OcrLanguage.Cebuano
' Define the input source containing the image or PDF with Cebuano text
Using Input = New OcrInput("images\Cebuano.png")
' Perform OCR to read the text from the input source
Dim Result = Ocr.Read(Input)
' Extract and display the recognized text
Dim AllText = Result.Text
Console.WriteLine(AllText)
End Using
End Sub
End Class
上述程式碼片段示範了如何使用 IronOCR,透過 C# 和 .NET 從圖片中讀取宿務語文字。 流程首先設定 OCR 引擎並指定宿務語,接著處理影像檔案,最後輸出擷取的文字。 請確保圖片路徑已針對您的專案環境正確指定。

