Tonga OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

Mais 126 idiomas

O IronOCR é um componente de software C# que permite aos desenvolvedores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o tonganês. Trata-se de uma versão avançada do Tesseract, desenvolvida exclusivamente para desenvolvedores .NET, e que supera regularmente outros mecanismos do Tesseract tanto em velocidade quanto em precisão.

Conteúdo de IronOcr.Languages.Tonga

Este pacote contém três modelos de linguagem OCR específicos para Tonga:

  • Tonga
  • TongaMelhor
  • TongaFast

Baixar

Pacote de Idiomas Tonga [faka Tonga]

  • Baixar como arquivo Zip .
  • Instalar com o NuGet .

Instalação

Para começar a usar os recursos de OCR de Tonga , instale o pacote Tonga OCR em seu projeto .NET usando o seguinte comando NuGet:

Install-Package IronOcr.Languages.Tonga

Exemplo de código

O exemplo de código C# a seguir demonstra como ler texto em tonganês a partir de uma imagem ou documento PDF usando o IronOCR.

// Include the necessary IronOcr namespace
using IronOcr;

class TongaOcrExample
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
// Include the necessary IronOcr namespace
using IronOcr;

class TongaOcrExample
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

Este exemplo de código demonstra a inicialização do mecanismo OCR IronTesseract e sua configuração para usar o idioma Tonga.

  • Carregamos uma imagem do caminho especificado em um objeto OcrInput.
  • O método Ocr.Read() processa a entrada para extrair o texto e então recuperamos o texto reconhecido através da propriedade Result.Text. Por fim, o texto extraído pode ser exibido ou processado conforme necessário no aplicativo.