Maori 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 Maori.
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.Maori
This package contains 40 OCR languages for .NET:
- Maori
- MaoriBest
- MaoriFast
Download
Maori Language Pack [te reo Māori]
Installation
The first thing we have to do is install our Maori OCR package to your .NET project.
Install-Package IronOCR.Languages.Maori
Code Example
This C# code example reads Maori text from an image or PDF document.
// Install the IronOCR Maori language package using NuGet
// PM> Install-Package IronOcr.Languages.Maori
using IronOcr;
var Ocr = new IronTesseract();
// Specify the language to be Maori
Ocr.Language = OcrLanguage.Maori;
using (var Input = new OcrInput(@"images\Maori.png"))
{
// Perform OCR to extract text
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Optionally, print the extracted text
// Console.WriteLine(AllText);
}
// Install the IronOCR Maori language package using NuGet
// PM> Install-Package IronOcr.Languages.Maori
using IronOcr;
var Ocr = new IronTesseract();
// Specify the language to be Maori
Ocr.Language = OcrLanguage.Maori;
using (var Input = new OcrInput(@"images\Maori.png"))
{
// Perform OCR to extract text
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Optionally, print the extracted text
// Console.WriteLine(AllText);
}
' Install the IronOCR Maori language package using NuGet
' PM> Install-Package IronOcr.Languages.Maori
Imports IronOcr
Private Ocr = New IronTesseract()
' Specify the language to be Maori
Ocr.Language = OcrLanguage.Maori
Using Input = New OcrInput("images\Maori.png")
' Perform OCR to extract text
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
' Optionally, print the extracted text
' Console.WriteLine(AllText);
End Using
Explanation
- IronTesseract is an instance that allows you to perform OCR.
- Ocr.Language is set to Maori to specify the language of the text we are reading.
- OcrInput is used to capture the input from an image with a specified file path.
- Ocr.Read() performs the OCR and retrieves the result.
- Result.Text contains the extracted text from the image, which can be stored or processed as needed.
This code setup ensures that the correct OCR language pack is utilized to achieve accurate text recognition.