Catalan OCR in C# and .NET
Outras versões deste documento:
O IronOCR é um componente de software em C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o catalão.
Trata-se de uma versão avançada do Tesseract, criada exclusivamente para desenvolvedores .NET , e que supera regularmente outros mecanismos do Tesseract tanto em velocidade quanto em precisão.
Conteúdo de IronOcr.Idiomas.Catalão
Este pacote contém 46 linguagens de OCR for .NET:
- Catalão
- CatalanBest
- CatalanFast
Baixar
Pacote de idioma catalão [català]
Instalação
A primeira coisa que precisamos fazer é instalar nosso pacote de OCR para catalão em seu projeto .NET .
Install-Package IronOcr.Languages.Catalan
Exemplo de código
Este exemplo de código C# lê texto catalão de uma imagem ou documento PDF.
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
class CatalanOcrExample
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the language for OCR processing to Catalan
Ocr.Language = OcrLanguage.Catalan;
// Define the input image or PDF from which you want to read the text
using (var Input = new OcrInput(@"images\Catalan.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Retrieve all recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
class CatalanOcrExample
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the language for OCR processing to Catalan
Ocr.Language = OcrLanguage.Catalan;
// Define the input image or PDF from which you want to read the text
using (var Input = new OcrInput(@"images\Catalan.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Retrieve all recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr
Friend Class CatalanOcrExample
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Set the language for OCR processing to Catalan
Ocr.Language = OcrLanguage.Catalan
' Define the input image or PDF from which you want to read the text
Using Input = New OcrInput("images\Catalan.png")
' Perform OCR reading on the input
Dim Result = Ocr.Read(Input)
' Retrieve all recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Class
Neste código:
- Criamos uma instância de
IronTesseractpara lidar com operações de OCR. - O
Ocr.Languageé especificado como Catalão, indicando que o mecanismo de OCR deve processar imagens usando o modelo de linguagem catalã. - Usamos
OcrInputpara especificar o caminho do arquivo da imagem ou documento PDF. - O método
Readé chamado no objetoOcr, e os resultados da leitura OCR são armazenados na variávelResult. - Finalmente,
Result.Textcontém o texto reconhecido, que é impresso no console.

