Sundanese OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Andere Versionen dieses Dokuments:

IronOCR ist eine C#-Softwarekomponente, die es .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Sundanesisch, zu lesen.

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

Inhalt von IronOcr.Languages.Sundanese

Dieses Paket enthält 52 OCR-Sprachen for .NET:

  • Sundanesisch
  • SundaneseBest
  • SundaneseFast

Download

Sundanese Sprachpaket [Basa Sunda]

Installation

Das erste, was wir tun müssen, ist, unser Sundanese OCR-Paket in Ihr .NET-Projekt zu installieren.

Install-Package IronOcr.Languages.Sundanese

Beispielcode

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

// Import the IronOcr namespace
using IronOcr;

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

        // Specify the language the OCR engine should use
        Ocr.Language = OcrLanguage.Sundanese;

        // Initialize the OCR input with an image file containing Sundanese text
        using (var Input = new OcrInput(@"images\Sundanese.png"))
        {
            // Process the input and get the result
            var Result = Ocr.Read(Input);

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

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

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

        // Specify the language the OCR engine should use
        Ocr.Language = OcrLanguage.Sundanese;

        // Initialize the OCR input with an image file containing Sundanese text
        using (var Input = new OcrInput(@"images\Sundanese.png"))
        {
            // Process the input and get the result
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

Erklärung

  • Zuerst importieren wir den Namespace IronOcr, um dessen OCR-Funktionalität zu nutzen. Es wird eine Instanz von IronTesseract erstellt, die als unsere Haupt-OCR-Engine fungiert.
  • Wir haben die Eigenschaft Language auf OcrLanguage.Sundanese gesetzt, um anzugeben, dass die Engine sundanesischen Text erwarten soll.
  • Wir erstellen ein OcrInput Objekt, um die Bilddateiquelle für unsere OCR-Engine anzugeben. Die Methode Read verarbeitet die Eingabe und versucht, Text zu erkennen. Der erkannte Text wird in der Variable AllText gespeichert und anschließend auf der Konsole ausgegeben.

Dieses Setup ermöglicht die robuste Erkennung sundanesischer Sprachtexte aus Bildern mit der IronOCR-Bibliothek in einer .NET-Umgebung.