Gurmukhi Alphabet OCR in C# and .NET
IronOCR to komponent oprogramowania C#, który pozwala programistom .NET czytać tekst z obrazów i dokumentów PDF w 126 językach, w tym w alfabecie gurmukhi.
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.Gurmukhi
Ten pakiet zawiera 73 języki OCR dla .NET:
- GurmukhiAlphabet
- GurmukhiAlphabetBest
- GurmukhiAlphabetFast
Pobieranie
Gurmukhi Alphabet Language Pack [Gurmukhī]
Instalacja
Pierwszą rzeczą, którą musimy zrobić, to zainstalować nasz pakiet OCR alfabetu gurmukhi do projektu .NET.
Install-Package IronOcr.Languages.Gurmukhi
Przyklad kodu
Ten przykład kodu C# odczytuje tekst alfabetu gurmukhi z obrazu lub dokumentu PDF.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the OCR language to Gurmukhi
Ocr.Language = OcrLanguage.Gurmukhi;
// Define the input source for OCR using an image file path
using (var Input = new OcrInput(@"images\Gurmukhi.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the OCR language to Gurmukhi
Ocr.Language = OcrLanguage.Gurmukhi;
// Define the input source for OCR using an image file path
using (var Input = new OcrInput(@"images\Gurmukhi.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the OCR language to Gurmukhi
Ocr.Language = OcrLanguage.Gurmukhi
' Define the input source for OCR using an image file path
Using Input = New OcrInput("images\Gurmukhi.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Class
- Upewnij się, że w projekcie zainstalowane są niezbędne biblioteki IronOCR, aby używać pakietu językowego gurmukhi.
- Zmodyfikuj ścieżkę
"images\Gurmukhi.png", aby wskazywała rzeczywisty plik obrazu, który chcesz przetworzyć. - Ten program odczytuje tekst z określonego obrazu i wyprowadza go na konsolę.

