Tibetan Alphabet OCR in C# and .NET
Curtis Chau
Updated: 2026年4月23日
IronOCR 是一個 C# 軟體元件,讓 .NET 開發人員能夠從 126 種語言的圖片和 PDF 文件中讀取文字,其中包括藏文。
這是 Tesseract 的進階分支版本,專為 .NET 開發者打造,其速度與準確度均經常優於其他 Tesseract 引擎。
IronOcr.Languages.Tibetan 的內容
此套件包含 114 種適用於 .NET 的 OCR 語言:
- 藏文
- 藏文Best
- 藏文Fast
- 藏文字母
- 藏文字母Best
- 藏文字母Fast
下載
藏文語系套件 [藏文標準]
安裝
您首先需要將"藏文字母 OCR"套件安裝至您的 .NET 專案中。
程式碼範例
此 C# 程式碼範例用於從圖片或 PDF 文件中讀取藏文字元。
// Import the IronOcr namespace to use its components
using IronOcr;
class Program
{
static void Main()
{
// Initialize a new IronTesseract object for OCR
var Ocr = new IronTesseract();
// Set the OCR language to Tibetan
Ocr.Language = OcrLanguage.Tibetan;
// Use a using statement for automatic resource disposal
using (var Input = new OcrInput(@"images\Tibetan.png"))
{
// Perform OCR to read text from the input image
var Result = Ocr.Read(Input);
// Retrieve all recognized text from the OCR Result
var AllText = Result.Text;
// Output the recognized text to the console
// Note: Ensure that the console supports Tibetan script for correct display
Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace to use its components
Imports IronOcr
Module Program
Sub Main()
' Initialize a new IronTesseract object for OCR
Dim Ocr As New IronTesseract()
' Set the OCR language to Tibetan
Ocr.Language = OcrLanguage.Tibetan
' Use a Using statement for automatic resource disposal
Using Input As New OcrInput("images\Tibetan.png")
' Perform OCR to read text from the input image
Dim Result = Ocr.Read(Input)
' Retrieve all recognized text from the OCR Result
Dim AllText = Result.Text
' Output the recognized text to the console
' Note: Ensure that the console supports Tibetan script for correct display
Console.WriteLine(AllText)
End Using
End Sub
End Module' Import the IronOcr namespace to use its components
Imports IronOcr
Module Program
Sub Main()
' Initialize a new IronTesseract object for OCR
Dim Ocr As New IronTesseract()
' Set the OCR language to Tibetan
Ocr.Language = OcrLanguage.Tibetan
' Use a Using statement for automatic resource disposal
Using Input As New OcrInput("images\Tibetan.png")
' Perform OCR to read text from the input image
Dim Result = Ocr.Read(Input)
' Retrieve all recognized text from the OCR Result
Dim AllText = Result.Text
' Output the recognized text to the console
' Note: Ensure that the console supports Tibetan script for correct display
Console.WriteLine(AllText)
End Using
End Sub
End Module備註
- OCR 函式庫 (
IronTesseract) 已設定為從提供的圖片中讀取藏文。 OcrInput負責載入輸入圖片,並透過using語句確保資源被正確釋放。Result.Text包含經 OCR 處理的文字,可直接列印或在應用程式中使用。
Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。