C# 和 .NET 中的巴斯克语 OCR
Curtis Chau
更新:
本文档的其他版本:
IronOCR 是一个 C# 软件组件,.NET 开发人员可用它从图像和 PDF 文档中读取 126 种语言(包括巴斯克语)的文本。
IronOCR 是 Tesseract 的高级分支,专为 .NET 开发人员打造,识别速度和准确率通常优于其他 Tesseract 引擎。
IronOcr.Languages.Basque 的内容
此软件包包含 43 种适用于 .NET 的 OCR 语言:
- Basque
- BasqueBest
- BasqueFast
下载
巴斯克语语言包 [euskara]
安装
首先,在 .NET 项目中安装 巴斯克语 OCR 软件包。
代码示例
此 C# 代码示例从图像或 PDF 文档中读取巴斯克语文本。
// Import the IronOcr namespace
using IronOcr;
class BasqueOCRExample
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Basque
Ocr.Language = OcrLanguage.Basque;
// Read the text from a Basque image or PDF
using (var Input = new OcrInput(@"images\Basque.png"))
{
// Perform OCR to get the result
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the extracted text
System.Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Friend Class BasqueOCRExample
Shared Sub Main()
' Create a new instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the language to Basque
Ocr.Language = OcrLanguage.Basque
' Read the text from a Basque image or PDF
Using Input = New OcrInput("images\Basque.png")
' Perform OCR to get the result
Dim Result = Ocr.Read(Input)
' Extract all text from the OCR result
Dim AllText = Result.Text
' Output the extracted text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class' Import the IronOcr namespace
Imports IronOcr
Friend Class BasqueOCRExample
Shared Sub Main()
' Create a new instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the language to Basque
Ocr.Language = OcrLanguage.Basque
' Read the text from a Basque image or PDF
Using Input = New OcrInput("images\Basque.png")
' Perform OCR to get the result
Dim Result = Ocr.Read(Input)
' Extract all text from the OCR result
Dim AllText = Result.Text
' Output the extracted text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class此示例使用 IronOCR 配置 OCR 引擎以识别巴斯克语。代码加载图像或路径所指向的 PDF 文件,执行 OCR 并提取全部文本,最后将文本输出到控制台。
Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。