Khmer OCR in C# and .NET

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

這個套件包含 102 種 .NET 的 OCR 語言:

  • 柬埔寨語
  • 柬埔寨語Best
  • 柬埔寨語Fast
  • 柬埔寨語Alphabet
  • 柬埔寨語AlphabetBest
  • 柬埔寨語AlphabetFast

下載

柬埔寨語言包 style='white-space:normal'>[ខមែរ]

安裝

我們必須做的第一件事就是安裝 柬埔寨語 OCR 套件到您的 .NET 項目。

Install-Package IronOCR.Languages.Khmer

代碼示例

這個 C# 代碼範例從圖像或 PDF 文件中讀取柬埔寨語文本。

// Make sure the IronOCR package is installed:
// PM> Install-Package IronOcr.Languages.Khmer
using IronOcr;

class KhmerOcrExample
{
    static void Main(string[] args)
    {
        // Create a new instance of IronTesseract for OCR processes
        var Ocr = new IronTesseract();

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

        // Define the path of the image file containing Khmer text
        using (var Input = new OcrInput(@"images\Khmer.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Make sure the IronOCR package is installed:
// PM> Install-Package IronOcr.Languages.Khmer
using IronOcr;

class KhmerOcrExample
{
    static void Main(string[] args)
    {
        // Create a new instance of IronTesseract for OCR processes
        var Ocr = new IronTesseract();

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

        // Define the path of the image file containing Khmer text
        using (var Input = new OcrInput(@"images\Khmer.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
' Make sure the IronOCR package is installed:
' PM> Install-Package IronOcr.Languages.Khmer
Imports IronOcr

Friend Class KhmerOcrExample
	Shared Sub Main(ByVal args() As String)
		' Create a new instance of IronTesseract for OCR processes
		Dim Ocr = New IronTesseract()

		' Specify the language for OCR as Khmer
		Ocr.Language = OcrLanguage.Khmer

		' Define the path of the image file containing Khmer text
		Using Input = New OcrInput("images\Khmer.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Retrieve the recognized text
			Dim AllText = Result.Text

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

此示例展示了如何在 .NET C# 應用程式中使用 IronOCR 從圖像文件中讀取柬埔寨語文字。