Gurmukhi Alphabet OCR in C# and .NET
Curtis Chau
Updated: 2026年6月29日
IronOCR 是一款 C# 軟體元件,讓 .NET 開發人員能夠從 126 種語言的圖像和 PDF 文件中讀取文字,其中包括古木基文字。
這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或準確度方面,表現均定期超越其他 Tesseract 引擎。
IronOcr.Languages.Gurmukhi 的內容
此套件包含 73 種適用於 .NET 的 OCR 語言:
- 古木基字母
- 古木基字母Best
- 古木基字母Fast
下載
古木基字母語言套件 [Gurmukhī]
安裝
我們首先必須將古木基字母 OCR 套件安裝至您的 .NET 專案中。
程式碼範例
此 C# 程式碼範例可從圖片或 PDF 文件中讀取古木基文字。
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the OCR language to Gurmukhi
Ocr.Language = OcrLanguage.Gurmukhi;
// Define the input source for OCR using an image file path
using (var Input = new OcrInput(@"images\Gurmukhi.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Module Program
Sub Main()
' Create a new instance of IronTesseract
Dim Ocr As New IronTesseract()
' Set the OCR language to Gurmukhi
Ocr.Language = OcrLanguage.Gurmukhi
' Define the input source for OCR using an image file path
Using Input As New OcrInput("images\Gurmukhi.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Module- 請確保您的專案中已安裝必要的 IronOCR 程式庫,以便使用古木基語語言套件。
- 請修改路徑
"images\Gurmukhi.png",使其指向您要處理的實際圖像檔案。 - 此程式會從指定的圖片中讀取文字,並將其輸出至控制台。

技術作家
Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。
...
閱讀更多