Cherokee OCR in C

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.Cherokee 的內容

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

  • CherokeeAlphabet
  • CherokeeAlphabetBest
  • CherokeeAlphabetFast
  • Cherokee
  • CherokeeBest
  • CherokeeFast

下載

切羅基語語言套件 [ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ]

安裝

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

Install-Package IronOcr.Languages.Cherokee

程式碼範例

此 C# 程式碼範例用於從圖片或 PDF 文件中讀取切羅基語文字。

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of the IronTesseract class
        var Ocr = new IronTesseract();

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

        // Use OcrInput to specify the image or PDF to be read
        using (var Input = new OcrInput(@"images\Cherokee.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Display the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of the IronTesseract class
        var Ocr = new IronTesseract();

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

        // Use OcrInput to specify the image or PDF to be read
        using (var Input = new OcrInput(@"images\Cherokee.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Display the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create an instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

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

		' Use OcrInput to specify the image or PDF to be read
		Using Input = New OcrInput("images\Cherokee.png")
			' Perform OCR on the input document
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Display the recognized text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

以下是關於程式碼運作方式的簡要說明:

  • IronTesseract:建立 IronTesseract 類別的實例以處理 OCR 操作。
  • OcrLanguage.Cherokee:透過 OcrLanguage.Cherokee 屬性將語言設定為切羅基語,此設定會指示 OCR 引擎識別切羅基語文字。
  • OcrInput:提供一個輸入路徑至 OcrInput 類別,該路徑存放著圖像或 PDF 文件。
  • Ocr.Read:在 OCR 物件上呼叫 Read 方法,並傳入輸入內容。 它執行 OCR 處理。
  • Result.Text:從結果中擷取已識別的文字,並將其儲存於 AllText 變數中以供後續使用。
  • 控制台輸出:識別出的文字將輸出至控制台。