Assamese OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

126 種其他語言

IronOCR 是一個 C# 軟體元件,讓 .NET 程式設計師能夠從 126 種語言(包括阿薩姆語)的圖片和 PDF 文件中讀取文字。

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

IronOcr.Languages.Assamese 的內容

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

  • 阿薩姆語
  • 阿薩姆語最佳
  • 阿薩姆語 (快速)

下載

阿薩姆語語言套件 [অসমীযা]

安裝

我們首先必須將阿薩姆語 OCR 套件安裝至您的 .NET 專案中。

Install-Package IronOcr.Languages.Assamese

程式碼範例

此 C# 程式碼範例可從圖片或 PDF 文件中讀取阿薩姆語文字。

// Make sure to install the necessary package:
// PM> Install-Package IronOcr.Languages.Assamese

using IronOcr;

class OCRExample
{
    public void ReadAssameseText()
    {
        // Create an instance of IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the language to Assamese
        Ocr.Language = OcrLanguage.Assamese;

        // Create an OCR input object with the specified image or PDF file
        using (var Input = new OcrInput(@"images\Assamese.png"))
        {
            // Read the text from the input file
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Make sure to install the necessary package:
// PM> Install-Package IronOcr.Languages.Assamese

using IronOcr;

class OCRExample
{
    public void ReadAssameseText()
    {
        // Create an instance of IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the language to Assamese
        Ocr.Language = OcrLanguage.Assamese;

        // Create an OCR input object with the specified image or PDF file
        using (var Input = new OcrInput(@"images\Assamese.png"))
        {
            // Read the text from the input file
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Make sure to install the necessary package:
' PM> Install-Package IronOcr.Languages.Assamese

Imports IronOcr

Friend Class OCRExample
	Public Sub ReadAssameseText()
		' Create an instance of IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Set the language to Assamese
		Ocr.Language = OcrLanguage.Assamese

		' Create an OCR input object with the specified image or PDF file
		Using Input = New OcrInput("images\Assamese.png")
			' Read the text from the input file
			Dim Result = Ocr.Read(Input)

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

			' Output the recognized text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • IronTesseract:這是負責 OCR 操作的主要類別。
  • OcrLanguage.Assamese:此參數指定 OCR 所使用的語言。 在此案例中,設定為阿薩姆語。
  • OcrInput:此類別用於載入您欲從中擷取文字的圖片或 PDF 檔案。
  • Result.Text:包含從圖片或 PDF/A 中擷取的完整文字內容。