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。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。