C# 和 .NET 中的荷兰语 OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

荷兰语 新增 125 种 OCR 语言

IronOCR 是一个 C# 软件组件,允许 .NET 程序员从图像和 PDF 文档中读取 126 种语言(包括荷兰语)的文本。

它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。

IronOcr.Languages.Dutch 的内容

此软件包包含 40 种适用于 .NET 的 OCR 语言:

  • 荷兰语
  • 荷兰语Best
  • 荷兰语Fast

下载

荷兰语语言包[Nederlands]

安装

我们首先需要做的是将荷兰语OCR 包安装到您的 .NET 项目中。

Install-Package IronOCR.Languages.Dutch

代码示例

这段 C# 代码示例从图像或 PDF 文档中读取荷兰语文本。

// The first step is to ensure the IronOcr.Languages.Dutch package is installed.
// You can do this from the Package Manager Console with the command:
// PM> Install-Package IronOcr.Languages.Dutch

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Dutch.
// This is crucial for recognizing text in that language effectively.
Ocr.Language = OcrLanguage.Dutch;

// Use a using statement to manage the OcrInput resource lifecycle.
using (var Input = new OcrInput(@"images\Dutch.png"))
{
    // Read the image and perform OCR to extract text.
    var Result = Ocr.Read(Input);

    // Store the recognized text into a variable.
    var AllText = Result.Text;

    // You can now use the extracted text stored in AllText.
}
// The first step is to ensure the IronOcr.Languages.Dutch package is installed.
// You can do this from the Package Manager Console with the command:
// PM> Install-Package IronOcr.Languages.Dutch

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Dutch.
// This is crucial for recognizing text in that language effectively.
Ocr.Language = OcrLanguage.Dutch;

// Use a using statement to manage the OcrInput resource lifecycle.
using (var Input = new OcrInput(@"images\Dutch.png"))
{
    // Read the image and perform OCR to extract text.
    var Result = Ocr.Read(Input);

    // Store the recognized text into a variable.
    var AllText = Result.Text;

    // You can now use the extracted text stored in AllText.
}
' The first step is to ensure the IronOcr.Languages.Dutch package is installed.
' You can do this from the Package Manager Console with the command:
' PM> Install-Package IronOcr.Languages.Dutch

Imports IronOcr

Private Ocr = New IronTesseract()

' Set the OCR language to Dutch.
' This is crucial for recognizing text in that language effectively.
Ocr.Language = OcrLanguage.Dutch

' Use a using statement to manage the OcrInput resource lifecycle.
Using Input = New OcrInput("images\Dutch.png")
	' Read the image and perform OCR to extract text.
	Dim Result = Ocr.Read(Input)

	' Store the recognized text into a variable.
	Dim AllText = Result.Text

	' You can now use the extracted text stored in AllText.
End Using
$vbLabelText   $csharpLabel

这段代码在 C# 中设置了一个 OCR 程序,用于读取荷兰语文本。 它会初始化 IronTesseract 对象,指定 OCR 语言,并处理输入的图像文件。处理结果是从文件中提取的文本,您可以根据需要在应用程序中使用。