C# 和 .NET 中的白俄罗斯语 OCR
This article was translated from English: Does it need improvement?
TranslatedView the article in English
Other versions of this document:
IronOCR 是一个 C# 软件组件,允许 .NET 程序员从图像和 PDF 文档中读取 126 种语言(包括白俄罗斯语)的文本。
它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。
IronOcr.Languages.Belarusian 的内容
此软件包包含 55 种适用于 .NET 的 OCR 语言:
- 白俄罗斯语
- 白俄罗斯语最佳
- 白俄罗斯语快速
下载
白俄罗斯语包
安装
我们首先需要做的是将我们的白俄罗斯OCR 包安装到您的 .NET 项目中。
Install-Package IronOCR.Languages.Belarusian
代码示例
这段 C# 代码示例从图像或 PDF 文档中读取白俄罗斯语文本。
// Import the IronOcr namespace to access OCR functionalities
using IronOcr;
class BelarusianOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the language to Belarusian for optimal recognition results
Ocr.Language = OcrLanguage.Belarusian;
// Define the input source: Image or PDF from a path
using (var Input = new OcrInput(@"images\Belarusian.png"))
{
// Perform OCR to read the text
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text to the console
System.Console.WriteLine(AllText);
}
}
}// Import the IronOcr namespace to access OCR functionalities
using IronOcr;
class BelarusianOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the language to Belarusian for optimal recognition results
Ocr.Language = OcrLanguage.Belarusian;
// Define the input source: Image or PDF from a path
using (var Input = new OcrInput(@"images\Belarusian.png"))
{
// Perform OCR to read the text
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text to the console
System.Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace to access OCR functionalities
Imports IronOcr
Friend Class BelarusianOcrExample
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the language to Belarusian for optimal recognition results
Ocr.Language = OcrLanguage.Belarusian
' Define the input source: Image or PDF from a path
Using Input = New OcrInput("images\Belarusian.png")
' Perform OCR to read the text
Dim Result = Ocr.Read(Input)
' Extract the recognized text
Dim AllText = Result.Text
' Output the recognized text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class$vbLabelText $csharpLabel





