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.Turkish 的内容

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

  • 土耳其语
  • TurkishBest
  • TurkishFast

下载

土耳其语语言包[土耳其语]

安装

第一步是使用以下 NuGet 包管理器命令在您的 .NET 项目中安装土耳其语OCR 包。

Install-Package IronOCR.Languages.Turkish

代码示例

此 C# 代码示例演示了如何从图像或 PDF 文档中读取土耳其语文本。

// Import the IronOcr namespace
using IronOcr;

class OCRExample
{
    static void Main()
    {
        // Create a new IronTesseract object
        var Ocr = new IronTesseract();

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

        // Define the input using a path to the image or PDF file
        using (var Input = new OcrInput(@"images\Turkish.png"))
        {
            // Perform the OCR reading operation
            var Result = Ocr.Read(Input);

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

            // Print the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class OCRExample
{
    static void Main()
    {
        // Create a new IronTesseract object
        var Ocr = new IronTesseract();

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

        // Define the input using a path to the image or PDF file
        using (var Input = new OcrInput(@"images\Turkish.png"))
        {
            // Perform the OCR reading operation
            var Result = Ocr.Read(Input);

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

            // Print the extracted text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class OCRExample
	Shared Sub Main()
		' Create a new IronTesseract object
		Dim Ocr = New IronTesseract()

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

		' Define the input using a path to the image or PDF file
		Using Input = New OcrInput("images\Turkish.png")
			' Perform the OCR reading operation
			Dim Result = Ocr.Read(Input)

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

			' Print the extracted text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

这段代码使用 IronOCR 设置 OCR 流程,从输入图像中读取土耳其语文本。 然后,它将提取的文本打印到控制台。