使用 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.Telugu 的內容

此軟體包包含多個與泰盧固語相關的 .NET OCR 語言模型:

  • 泰盧固語
  • TeluguBest
  • TeluguFast
  • 泰盧固語字母
  • TeluguAlphabetBest
  • TeluguAlphabetFast

下載

泰盧固語語言包[泰盧固語]

安裝

第一步是將Telugu OCR 套件安裝到您的 .NET 專案中。

Install-Package IronOCR.Languages.Telugu

程式碼範例

這是一個 C# 程式碼範例,用於從圖像或 PDF 文件中讀取泰盧固語文字。

// Ensure that you have installed the IronOCR.Languages.Telugu package before running this code.

using IronOcr;

public class TeluguOcrExample
{
    public static void Main()
    {
        // Create a new IronTesseract instance
        var Ocr = new IronTesseract();

        // Specify the OCR language as Telugu
        Ocr.Language = OcrLanguage.Telugu;

        // Create a new OcrInput and specify the path to the image or PDF
        using (var Input = new OcrInput(@"images\Telugu.png"))
        {
            // Perform OCR on the input file
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console (optional)
            Console.WriteLine(AllText);
        }
    }
}
// Ensure that you have installed the IronOCR.Languages.Telugu package before running this code.

using IronOcr;

public class TeluguOcrExample
{
    public static void Main()
    {
        // Create a new IronTesseract instance
        var Ocr = new IronTesseract();

        // Specify the OCR language as Telugu
        Ocr.Language = OcrLanguage.Telugu;

        // Create a new OcrInput and specify the path to the image or PDF
        using (var Input = new OcrInput(@"images\Telugu.png"))
        {
            // Perform OCR on the input file
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console (optional)
            Console.WriteLine(AllText);
        }
    }
}
' Ensure that you have installed the IronOCR.Languages.Telugu package before running this code.

Imports IronOcr

Public Class TeluguOcrExample
	Public Shared Sub Main()
		' Create a new IronTesseract instance
		Dim Ocr = New IronTesseract()

		' Specify the OCR language as Telugu
		Ocr.Language = OcrLanguage.Telugu

		' Create a new OcrInput and specify the path to the image or PDF
		Using Input = New OcrInput("images\Telugu.png")
			' Perform OCR on the input file
			Dim Result = Ocr.Read(Input)

			' Extract and store the recognized text
			Dim AllText = Result.Text

			' Output the recognized text to the console (optional)
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

這段程式碼片段使用 IronOCR 套件初始化 OCR 引擎,設定 OCR 處理的語言為泰盧固語,並從使用者指定的輸入影像檔案中讀取文字。