Gurmukhi Alphabet OCR in C# and .NET
IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 languages, including the Gurmukhi Alphabet.
It is an advanced fork of Tesseract, built exclusively for .NET developers and regularly outperforms other Tesseract engines in both speed and accuracy.
Contents of IronOcr.Languages.Gurmukhi
This package contains 73 OCR languages for .NET:
- GurmukhiAlphabet
- GurmukhiAlphabetBest
- GurmukhiAlphabetFast
Download
Gurmukhi Alphabet Language Pack [Gurmukhī]
Installation
The first thing we have to do is install our Gurmukhi Alphabet OCR package to your .NET project.
Install-Package IronOCR.Languages.Gurmukhi
Code Example
This C# code example reads Gurmukhi Alphabet text from an Image or PDF document.
// 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
- Ensure that the necessary IronOCR libraries are installed in your project to use the Gurmukhi language pack.
- Modify the path
"images\Gurmukhi.png"
to point to the actual image file you want to process. - This program reads text from the specified image and outputs it to the console.