Panjabi OCR in C# and .NET
Andere Versionen dieses Dokuments:
IronOCR ist eine C#-Softwarekomponente, die .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Panjabi, zu lesen. Es ist ein erweiterter Fork von Tesseract, der ausschließlich for .NET-Entwickler entwickelt wurde und regelmäßig andere Tesseract-Engines sowohl in Bezug auf Geschwindigkeit als auch Genauigkeit übertrifft.
Inhalte von IronOcr.Languages.Panjabi
Dieses Paket enthält 46 OCR-Sprachen for .NET:
- Panjabi
- PanjabiBest
- PanjabiFast
Download
Panjabi Sprachpaket [ਪਜਾਬੀ]
Installation
Das Erste, was wir tun müssen, ist das Panjabi OCR-Paket in Ihr .NET-Projekt zu installieren.
Install-Package IronOcr.Languages.Panjabi
Beispielcode
Dieses C#-Code-Beispiel liest Panjabi-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();
// Set the language to Panjabi
Ocr.Language = OcrLanguage.Panjabi;
// Define the input image or PDF file
using (var Input = new OcrInput(@"images\Panjabi.png"))
{
// Perform OCR on the input file
var Result = Ocr.Read(Input);
// Extract and store the recognized text from the OCR result
var AllText = Result.Text;
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the language to Panjabi
Ocr.Language = OcrLanguage.Panjabi;
// Define the input image or PDF file
using (var Input = new OcrInput(@"images\Panjabi.png"))
{
// Perform OCR on the input file
var Result = Ocr.Read(Input);
// Extract and store the recognized text from the OCR result
var AllText = Result.Text;
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Set the language to Panjabi
Ocr.Language = OcrLanguage.Panjabi
' Define the input image or PDF file
Using Input = New OcrInput("images\Panjabi.png")
' Perform OCR on the input file
Dim Result = Ocr.Read(Input)
' Extract and store the recognized text from the OCR result
Dim AllText = Result.Text
End Using
End Sub
End Class
Erklärung
- IronTesseract: Dies ist die Hauptklasse, die von IronOCR für OCR-Operationen bereitgestellt wird.
- Ocr.Language: Wir geben an, welche Sprache die OCR-Engine verwenden soll. Hier ist sie auf Panjabi eingestellt.
- OcrInput: Diese Klasse wird verwendet, um die Eingabedatei (Bild oder PDF) anzugeben, auf der OCR durchgeführt werden soll.
- Ocr.Read(): Diese Methode führt die eigentliche OCR-Aufgabe aus und gibt ein Ergebnis mit dem extrahierten Text zurück.
- Result.Text: Dies enthält den extrahierten Text, nachdem die OCR auf der Eingabedatei durchgeführt wurde.
Dieses Beispiel demonstriert, wie man die IronOCR-Bibliothek effektiv nutzen kann, um Panjabi-Text aus Bildern oder PDF-Dokumenten in einer .NET-Anwendung zu extrahieren.

