C# 中的宿务语 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.Cebuano 的内容

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

宿务语 宿务语Best 宿务语Fast

下载

宿务语语言包[Bisaya]

下载为Zip 文件

安装

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

Install-Package IronOCR.Languages.Cebuano

代码示例

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

// Install the IronOCR Cebuano language package via NuGet package manager 
// PM> Install-Package IronOcr.Languages.Cebuano

using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate an IronTesseract object
        var Ocr = new IronTesseract();

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

        // Define the input source containing the image or PDF with Cebuano text
        using (var Input = new OcrInput(@"images\Cebuano.png"))
        {
            // Perform OCR to read the text from the input source
            var Result = Ocr.Read(Input);

            // Extract and display the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
// Install the IronOCR Cebuano language package via NuGet package manager 
// PM> Install-Package IronOcr.Languages.Cebuano

using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate an IronTesseract object
        var Ocr = new IronTesseract();

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

        // Define the input source containing the image or PDF with Cebuano text
        using (var Input = new OcrInput(@"images\Cebuano.png"))
        {
            // Perform OCR to read the text from the input source
            var Result = Ocr.Read(Input);

            // Extract and display the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
' Install the IronOCR Cebuano language package via NuGet package manager 
' PM> Install-Package IronOcr.Languages.Cebuano

Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Instantiate an IronTesseract object
		Dim Ocr = New IronTesseract()

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

		' Define the input source containing the image or PDF with Cebuano text
		Using Input = New OcrInput("images\Cebuano.png")
			' Perform OCR to read the text from the input source
			Dim Result = Ocr.Read(Input)

			' Extract and display the recognized text
			Dim AllText = Result.Text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

上面的代码片段演示了如何使用 IronOCR 和 C# 和 .NET 从图像中读取宿务语文本。 它首先设置 OCR 引擎并指定宿务语,然后处理图像文件并输出提取的文本。 请确保已为项目环境正确指定镜像路径。