Tamil OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
本文件的其他版本:

IronOCR 是一款 C# 軟體元件,讓 .NET 開發人員能夠從 126 種語言(包括泰米爾語)的圖片和 PDF 文件中讀取文字。

這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或準確度方面,其表現均經常優於其他 Tesseract 引擎。

IronOcr.Languages.Tamil 的內容

此套件包含 102 種適用於 .NET 的 OCR 語言:

  • 泰米爾語
  • 泰米爾語Best
  • 泰米爾語Fast
  • 泰米爾語Alphabet
  • 泰米爾語AlphabetBest
  • 泰米爾語AlphabetFast

下載

泰米爾語語言套件 [தமிழ]

安裝

我們首先必須將泰米爾語 OCR 套件安裝至您的 .NET 專案中。

Install-Package IronOcr.Languages.Tamil

程式碼範例

此 C# 程式碼範例用於從圖片或 PDF 文件中讀取泰米爾文。

// Ensure IronOcr.Languages.Tamil package is installed
using IronOcr;

var Ocr = new IronTesseract();

// Set the language to Tamil for OCR processing
Ocr.Language = OcrLanguage.Tamil;

using (var Input = new OcrInput(@"images\Tamil.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Get the recognized text
    var AllText = Result.Text;

    // Display the recognized text (for example purpose)
    Console.WriteLine(AllText);
}
// Ensure IronOcr.Languages.Tamil package is installed
using IronOcr;

var Ocr = new IronTesseract();

// Set the language to Tamil for OCR processing
Ocr.Language = OcrLanguage.Tamil;

using (var Input = new OcrInput(@"images\Tamil.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Get the recognized text
    var AllText = Result.Text;

    // Display the recognized text (for example purpose)
    Console.WriteLine(AllText);
}
Imports IronOcr

' Ensure IronOcr.Languages.Tamil package is installed
Dim Ocr As New IronTesseract()

' Set the language to Tamil for OCR processing
Ocr.Language = OcrLanguage.Tamil

Using Input As New OcrInput("images\Tamil.png")
    ' Perform OCR on the input image
    Dim Result = Ocr.Read(Input)

    ' Get the recognized text
    Dim AllText = Result.Text

    ' Display the recognized text (for example purpose)
    Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel
  • IronTesseract 類別用於初始化並設定 OCR 引擎。
  • Ocr.Language 屬性指定用於 OCR 的語言套件。
  • OcrInput 類別用於指定包含泰米爾文的圖像檔案路徑。
  • Ocr.Read() 方法會處理圖片並擷取其中的文字。
  • 最後,識別出的文字會儲存於 AllText 中,並可視需要加以利用。