Khmer OCR in C# and .NET
Inne wersje tego dokumentu:
IronOCR to komponent oprogramowania C#, który umożliwia programistom .NET odczytywanie tekstu z obrazów i dokumentów PDF w 126 językach, w tym po khmersku.
Jest to zaawansowany fork Tesseract, stworzony wyłącznie dla programistów .NET i regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.
Zawartość IronOcr.Languages.Khmer
Ten pakiet zawiera 102 języki OCR dla .NET:
- Khmer
- KhmerBest
- KhmerFast
- KhmerAlphabet
- KhmerAlphabetBest
- KhmerAlphabetFast
Pobieranie
Khmer Language Pack [ខមែរ]
Instalacja
Pierwszą rzeczą, którą musimy zrobić, to zainstalować pakiet OCR Khmer do twojego projektu .NET.
Install-Package IronOcr.Languages.Khmer
Przyklad kodu
Ten przykład kodu C# odczytuje tekst khmerski z obrazu lub dokumentu 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
Ten przykład demonstruje, jak odczytać tekst khmerski z pliku obrazu za pomocą IronOCR w aplikacji C# .NET.

