Catalan OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
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);
        }
    }
}
$vbLabelText   $csharpLabel

Neste código:

  • Criamos uma instância de IronTesseract para 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 OcrInput para especificar o caminho do arquivo da imagem ou documento PDF.
  • O método Read é chamado no objeto Ocr, e os resultados da leitura OCR são armazenados na variável Result.
  • Finalmente, Result.Text contém o texto reconhecido, que é impresso no console.