Bosnian 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 bósnio.

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 do IronOcr.Idiomas.Bósnio

Este pacote contém 46 linguagens de OCR for .NET:

  • Bósnio
  • Melhor da Bósnia
  • BósnioFast

Baixar

Pacote de idioma bósnio [bosanski jezik]

Instalação

A primeira coisa que precisamos fazer é instalar nosso pacote de OCR para bósnio em seu projeto .NET .

Install-Package IronOcr.Languages.Bosnian

Exemplo de código

Este exemplo de código C# lê texto em bósnio a partir de uma imagem ou documento PDF.

// Ensure the IronOCR library is included
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize an instance of IronTesseract
        var Ocr = new IronTesseract();

        // Set the OCR language to Bosnian
        Ocr.Language = OcrLanguage.Bosnian;

        // Use OcrInput to specify the input file path for OCR
        using (var Input = new OcrInput(@"images\Bosnian.png"))
        {
            // Perform OCR on the input image or PDF
            var Result = Ocr.Read(Input);

            // Extract the recognized text from the result
            var AllText = Result.Text;

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
// Ensure the IronOCR library is included
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize an instance of IronTesseract
        var Ocr = new IronTesseract();

        // Set the OCR language to Bosnian
        Ocr.Language = OcrLanguage.Bosnian;

        // Use OcrInput to specify the input file path for OCR
        using (var Input = new OcrInput(@"images\Bosnian.png"))
        {
            // Perform OCR on the input image or PDF
            var Result = Ocr.Read(Input);

            // Extract the recognized text from the result
            var AllText = Result.Text;

            // Output the recognized text to the console
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

O código acima demonstra como realizar OCR em uma imagem de texto bósnio usando o IronOCR.

  • A classe IronTesseract é usada para configurar e executar tarefas de OCR.
  • A classe OcrInput é usada para especificar o arquivo de imagem de entrada do qual o texto deve ser extraído.
  • Finalmente, o texto reconhecido é impresso no console.