C# 和 .NET 中的布列塔尼语 OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

还有126种语言

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

IronOcr.Languages.Breton 的内容

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

  • 布列塔尼语
  • 布列塔尼语Best
  • 布列塔尼语快速

下载

布列塔尼语语言包 [英语]

安装

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

Install-Package IronOCR.Languages.Breton

代码示例

此 C# 代码示例从图像或 PDF 文档中读取布列塔尼语文本。

// Import the IronOCR namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR language to Breton
        Ocr.Language = OcrLanguage.Breton;

        // Read text from a Breton image or PDF document
        using (var Input = new OcrInput(@"images\Breton.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

            // Extract text from the OCR result
            var AllText = Result.Text;

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOCR namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR language to Breton
        Ocr.Language = OcrLanguage.Breton;

        // Read text from a Breton image or PDF document
        using (var Input = new OcrInput(@"images\Breton.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

            // Extract text from the OCR result
            var AllText = Result.Text;

            // Output the extracted text
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOCR namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Breton
		Ocr.Language = OcrLanguage.Breton

		' Read text from a Breton image or PDF document
		Using Input = New OcrInput("images\Breton.png")
			' Perform OCR on the input
			Dim Result = Ocr.Read(Input)

			' Extract text from the OCR result
			Dim AllText = Result.Text

			' Output the extracted text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • 此示例演示如何使用 IronOCR 库对布列塔尼语文本图像执行 OCR。 IronTesseract提供核心 OCR 功能。
  • OcrInput是通过指向包含布列塔尼语文本的图像的路径创建的。
  • Read方法处理输入图像并提取文本,然后将文本输出到控制台。