使用 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.Filipino 的内容

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

  • 菲律宾人
  • FilipinoBest
  • FilipinoFast

下载

菲律宾语言包 [菲律宾的国家语言]

安装

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

Install-Package IronOCR.Languages.Filipino

代码示例

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

// Import the IronOcr namespace to use its classes and methods.
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract OCR engine.
        var Ocr = new IronTesseract();

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

        // Create a new OcrInput object, specifying the path to the image
        // or document that contains the text you want to read.
        using (var Input = new OcrInput(@"images\Filipino.png"))
        {
            // Perform OCR on the input.
            var Result = Ocr.Read(Input);

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

            // Output the text to the console or use it in your application.
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to use its classes and methods.
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract OCR engine.
        var Ocr = new IronTesseract();

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

        // Create a new OcrInput object, specifying the path to the image
        // or document that contains the text you want to read.
        using (var Input = new OcrInput(@"images\Filipino.png"))
        {
            // Perform OCR on the input.
            var Result = Ocr.Read(Input);

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

            // Output the text to the console or use it in your application.
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace to use its classes and methods.
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of the IronTesseract OCR engine.
		Dim Ocr = New IronTesseract()

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

		' Create a new OcrInput object, specifying the path to the image
		' or document that contains the text you want to read.
		Using Input = New OcrInput("images\Filipino.png")
			' Perform OCR on the input.
			Dim Result = Ocr.Read(Input)

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

			' Output the text to the console or use it in your application.
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel