使用 C# 和 .NET 进行信德语 OCR 识别

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

IronOCR 是一个 C# 软件组件,它允许 .NET 开发人员从图像和 PDF 文档中读取 126 种语言(包括信德语)的文本。 它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。

IronOcr.Languages.Sindhi 的内容

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

  • 信德语
  • 信德语Best
  • 信德语Fast

下载

信德语语言包[सिनधी]

安装

首先要做的是在您的 .NET 项目中安装Sindhi OCR 包。

Install-Package IronOCR.Languages.Sindhi

代码示例

此 C# 代码示例从图像或 PDF 文档中读取信德语文本。

// Ensure the IronOCR package and Sindhi language pack are installed
using IronOcr;

var Ocr = new IronTesseract
{
    Language = OcrLanguage.Sindhi  // Set the OCR language to Sindhi
};

// Open an image or PDF document for OCR processing
using (var Input = new OcrInput(@"images\Sindhi.png"))
{
    // Perform OCR and get the results
    var Result = Ocr.Read(Input);

    // Extract the recognized text
    var AllText = Result.Text;

    // Optionally, you can do something with the extracted text,
    // such as displaying or saving it to a file.
}
// Ensure the IronOCR package and Sindhi language pack are installed
using IronOcr;

var Ocr = new IronTesseract
{
    Language = OcrLanguage.Sindhi  // Set the OCR language to Sindhi
};

// Open an image or PDF document for OCR processing
using (var Input = new OcrInput(@"images\Sindhi.png"))
{
    // Perform OCR and get the results
    var Result = Ocr.Read(Input);

    // Extract the recognized text
    var AllText = Result.Text;

    // Optionally, you can do something with the extracted text,
    // such as displaying or saving it to a file.
}
' Ensure the IronOCR package and Sindhi language pack are installed
Imports IronOcr

Private Ocr = New IronTesseract With {.Language = OcrLanguage.Sindhi}

' Open an image or PDF document for OCR processing
Using Input = New OcrInput("images\Sindhi.png")
	' Perform OCR and get the results
	Dim Result = Ocr.Read(Input)

	' Extract the recognized text
	Dim AllText = Result.Text

	' Optionally, you can do something with the extracted text,
	' such as displaying or saving it to a file.
End Using
$vbLabelText   $csharpLabel

在此代码示例中:

  • 我们搭建了一个IronTesseract实例。
  • 将 OCR 语言设置为信德语。 打开一个包含信德语文本的图像文件。
  • 使用Read方法对图像执行 OCR 并提取文本。
  • 提取的文本存储在AllText变量中,以供进一步使用。