C# 和 .NET 中的阿萨姆语 OCR
Curtis Chau
更新:
IronOCR 是一个 C# 软件组件,.NET 开发人员可用它从图像和 PDF 文档中读取 126 种语言(包括阿萨姆语)的文本。
IronOCR 是 Tesseract 的高级分支,专为 .NET 开发人员打造,识别速度和准确率通常优于其他 Tesseract 引擎。
IronOcr.Languages.Assamese 的内容
此软件包包含 49 种适用于 .NET 的 OCR 语言:
- Assamese
- AssameseBest
- AssameseFast
下载
阿萨姆语语言包[阿萨姆语]
安装
首先,在 .NET 项目中安装 阿萨姆语 OCR 软件包。
代码示例
这段 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。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。