Marathi OCR in C# and .NET
Outras versões deste documento:
IronOCR é um componente de software C# que permite aos desenvolvedores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo Marata.
Trata-se de uma versão avançada do Tesseract, criada exclusivamente para desenvolvedores .NET e que supera regularmente outros mecanismos do Tesseract em termos de velocidade e precisão.
Conteúdos de IronOcr.Languages.Marathi
Este pacote contém 46 linguagens de OCR for .NET:
- Marata
- MarathiBest
- MarathiFast
Baixar
Pacote de Idioma Marata [मराठी]
Instalação
A primeira coisa que precisamos fazer é instalar nosso pacote OCR Marathi no seu projeto .NET.
Install-Package IronOcr.Languages.Marathi
Exemplo de código
Este exemplo de código C# lê texto em marata de uma imagem ou documento PDF.
// Include the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize the OCR engine
var Ocr = new IronTesseract();
// Specify the language as Marathi
Ocr.Language = OcrLanguage.Marathi;
// Load the image or PDF document to be processed
using (var Input = new OcrInput(@"images\Marathi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Get the recognized text
var AllText = Result.Text;
// Output the recognized text to console
Console.WriteLine(AllText);
}
}
}
// Include the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Initialize the OCR engine
var Ocr = new IronTesseract();
// Specify the language as Marathi
Ocr.Language = OcrLanguage.Marathi;
// Load the image or PDF document to be processed
using (var Input = new OcrInput(@"images\Marathi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Get the recognized text
var AllText = Result.Text;
// Output the recognized text to console
Console.WriteLine(AllText);
}
}
}
' Include the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize the OCR engine
Dim Ocr = New IronTesseract()
' Specify the language as Marathi
Ocr.Language = OcrLanguage.Marathi
' Load the image or PDF document to be processed
Using Input = New OcrInput("images\Marathi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Get the recognized text
Dim AllText = Result.Text
' Output the recognized text to console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Explicação:
- Este código usa a classe
IronTesseractda bibliotecaIronOCRpara realizar OCR. - A propriedade
Ocr.Languageestá configurada para usar o pacote de idioma Marathi. - Um
OcrInputé criado usando o caminho para a imagem ou PDF que contém o texto em Marathi. - O método
Ocr.Read()processa a entrada e extrai o texto. - O texto reconhecido é armazenado na variável
AllTexte impresso no console.

