Khmer OCR in C# and .NET

Other versions of this document:

IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 languages, including Khmer.

It is an advanced fork of Tesseract, built exclusively for the .NET developers and regularly outperforms other Tesseract engines for both speed and accuracy.

Contents of IronOcr.Languages.Khmer

This package contains 102 OCR languages for .NET:

  • Khmer
  • KhmerBest
  • KhmerFast
  • KhmerAlphabet
  • KhmerAlphabetBest
  • KhmerAlphabetFast

Download

Khmer Language Pack [ខ្មែរ]

Installation

The first thing we have to do is install the Khmer OCR package to your .NET project.

Install-Package IronOCR.Languages.Khmer

Code Example

This C# code example reads Khmer text from an Image or PDF document.

// 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

This example demonstrates how to read Khmer text from an image file using IronOCR in a .NET C# application.