Devanagari 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 Devanagari Alphabet. It is an advanced fork of Tesseract, built exclusively for .NET developers and regularly outperforms other Tesseract engines for both speed and accuracy.
Contents of IronOcr.Languages.Devanagari
This package contains 79 OCR languages for .NET:
- DevanagariAlphabet
- DevanagariAlphabetBest
- DevanagariAlphabetFast
Download
Devanagari Alphabet Language Pack [Nagair]
Installation
The first thing we have to do is install our Devanagari Alphabet OCR package to your .NET project.
Install-Package IronOCR.Languages.Devanagari
Code Example
This C# code example reads Devanagari Alphabet text from an image or PDF document.
// Ensure the IronOcr package is installed
// PM> Install-Package IronOcr.Languages.Devanagari
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Devanagari
Ocr.Language = OcrLanguage.Devanagari;
// Define the input file
using (var Input = new OcrInput(@"images\Devanagari.png"))
{
// Process the input file
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
// Ensure the IronOcr package is installed
// PM> Install-Package IronOcr.Languages.Devanagari
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Devanagari
Ocr.Language = OcrLanguage.Devanagari;
// Define the input file
using (var Input = new OcrInput(@"images\Devanagari.png"))
{
// Process the input file
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
' Ensure the IronOcr package is installed
' PM> Install-Package IronOcr.Languages.Devanagari
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the OCR language to Devanagari
Ocr.Language = OcrLanguage.Devanagari
' Define the input file
Using Input = New OcrInput("images\Devanagari.png")
' Process the input file
Dim Result = Ocr.Read(Input)
' Extract the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
The above code snippet demonstrates:
- Setting up the IronTesseract OCR engine.
- Configuring the OCR language to Devanagari.
- Reading an image file containing Devanagari text.
- Extracting and printing the recognized text to the console.