Galician OCR in C# and .NET
Other versions of this document:
IronOCR is a C# software component that enables .NET developers to extract text from images and PDF documents in 126 languages, including Galician.
It is an advanced fork of Tesseract, designed specifically for .NET developers, and consistently outperforms other Tesseract engines in both speed and accuracy.
Contents of IronOcr.Languages.Galician
This package contains 49 OCR languages for .NET, including:
- Galician
- GalicianBest
- GalicianFast
Download
Galician Language Pack [galego]
Installation
The first step to utilize the Galician OCR package in your .NET project is to install it.
Install-Package IronOCR.Languages.Galician
Code Example
The following C# code example demonstrates how to read Galician text from an image or PDF document.
// Include the IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Specify the language for OCR as Galician
Ocr.Language = OcrLanguage.Galician;
// Define the input source, here it is an image file
using (var Input = new OcrInput(@"images\Galician.png"))
{
// Perform the OCR process on the input image
var Result = Ocr.Read(Input);
// Retrieve the recognized text from the OCR result
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
// Include the IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Specify the language for OCR as Galician
Ocr.Language = OcrLanguage.Galician;
// Define the input source, here it is an image file
using (var Input = new OcrInput(@"images\Galician.png"))
{
// Perform the OCR process on the input image
var Result = Ocr.Read(Input);
// Retrieve the recognized text from the OCR result
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
' Include the IronOcr library
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Instantiate the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Specify the language for OCR as Galician
Ocr.Language = OcrLanguage.Galician
' Define the input source, here it is an image file
Using Input = New OcrInput("images\Galician.png")
' Perform the OCR process on the input image
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text from the OCR result
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
In the above code:
- We are using the IronTesseract class to create an OCR engine object.
- We set the OCR language to Galician which ensures the OCR engine accurately processes Galician text.
- We then read the image file located at "images\Galician.png" and get the recognized text.
- Finally, we print the recognized text to the console.