Lao 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 ist eine C# Softwarekomponente, die es .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Lao, zu lesen.

Es ist eine erweiterte Abspaltung von Tesseract, die exklusiv für .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.

Inhalte von IronOcr.Languages.Lao

Dieses Paket enthält mehrere OCR-Sprachmodelle für .NET:

  • Lao
  • LaoBest
  • LaoFast
  • LaoAlphabet
  • LaoAlphabetBest
  • LaoAlphabetFast

Download

Lao Sprachpaket style='white-space:default'>[ພາສາລາວ]

Installation

Das Erste, was wir tun müssen, ist das Lao OCR-Paket in Ihrem .NET-Projekt zu installieren.

Install-Package IronOCR.Languages.Lao

Beispielcode

Dieses C#-Codebeispiel liest Lao-Text aus einem Bild oder PDF-Dokument.

// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;

// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);
    // Extract all text from the OCR result
    var AllText = Result.Text;

    // Output the recognized text for verification
    Console.WriteLine(AllText);
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;

// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);
    // Extract all text from the OCR result
    var AllText = Result.Text;

    // Output the recognized text for verification
    Console.WriteLine(AllText);
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr

' Create a new IronTesseract instance
Private Ocr = New IronTesseract()
' Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao

' Use a using statement to ensure proper disposal of resources
Using Input = New OcrInput("images\Lao.png")
	' Perform OCR on the input image
	Dim Result = Ocr.Read(Input)
	' Extract all text from the OCR result
	Dim AllText = Result.Text

	' Output the recognized text for verification
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Erklärung:

  • Dieser Code zeigt, wie IronOCR speziell für die Lao-Sprache konfiguriert und verwendet wird.
  • IronTesseract ist die Hauptklasse, die für die Durchführung von OCR-Operationen verwendet wird.
  • Die Sprache wird mit Ocr.Language auf Lao gesetzt.
  • OcrInput ist eine Klasse, die zum Laden von Bildern oder PDF-Dokumenten für die OCR-Verarbeitung verwendet wird.
  • Die Methode Ocr.Read verarbeitet die Eingabe und gibt ein Ergebnis zurück, das den erkannten Text enthält.
  • Die using-Anweisung stellt sicher, dass Ressourcen nach der Verwendung freigegeben werden.
  • Schließlich wird der erkannte Text zur Verifizierung der Ausgabe in die Konsole gedruckt.