C# 與 .NET 中的阿薩姆語 OCR
Curtis Chau
已更新: 2026年8月2日
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括阿薩姆語)的文字。
它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Assamese 的內容
此軟體包包含 49 種適用於 .NET 的 OCR 語言:
- Assamese
- AssameseBest
- AssameseFast
下載
阿薩姆語語言包[阿薩姆語]
安裝
我們首先需要做的就是將我們的阿薩姆語OCR 套件安裝到您的 .NET 專案中。
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取阿薩姆語文字。
// Make sure to install the necessary package:
// PM> Install-Package IronOcr.Languages.Assamese
using IronOcr;
class OCRExample
{
public void ReadAssameseText()
{
// Create an instance of IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the language to Assamese
Ocr.Language = OcrLanguage.Assamese;
// Create an OCR input object with the specified image or PDF file
using (var Input = new OcrInput(@"images\Assamese.png"))
{
// Read the text from the input file
var Result = Ocr.Read(Input);
// Retrieve the text from the OCR result
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}' Make sure to install the necessary package:
' PM> Install-Package IronOcr.Languages.Assamese
Imports IronOcr
Class OCRExample
Public Sub ReadAssameseText()
' Create an instance of IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the language to Assamese
Ocr.Language = OcrLanguage.Assamese
' Create an OCR input object with the specified image or PDF file
Using Input As New OcrInput("images\Assamese.png")
' Read the text from the input file
Dim Result = Ocr.Read(Input)
' Retrieve the text from the OCR result
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class' Make sure to install the necessary package:
' PM> Install-Package IronOcr.Languages.Assamese
Imports IronOcr
Class OCRExample
Public Sub ReadAssameseText()
' Create an instance of IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the language to Assamese
Ocr.Language = OcrLanguage.Assamese
' Create an OCR input object with the specified image or PDF file
Using Input As New OcrInput("images\Assamese.png")
' Read the text from the input file
Dim Result = Ocr.Read(Input)
' Retrieve the text from the OCR result
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class- IronTesseract: 這是主要負責OCR操作的類別。
- OcrLanguage.Assamese: 這指定了OCR的語言。 在這種情況下,語言設定為阿薩姆語。
- OcrInput: 此類別用於載入您想要從中提取文字的圖像或PDF。
- Result.Text: 包含從圖像或PDF提取的完整文本。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。