English OCR in C# and .NET

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

Mais 126 idiomas

IronOCR é um componente de software em C# que permite aos desenvolvedores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo inglês.

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.English

Este pacote contém 64 idiomas de OCR for .NET:

Baixar

Pacote de Idioma Inglês [Inglês Moderno]

Exemplo de código

Este exemplo de código C# lê texto em inglês de uma imagem ou documento PDF.

// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to English
        Ocr.Language = OcrLanguage.English;

        // Define the input source as an image file
        using (var Input = new OcrInput(@"images\English.png"))
        {
            // Perform OCR to read the text from the input
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to English
        Ocr.Language = OcrLanguage.English;

        // Define the input source as an image file
        using (var Input = new OcrInput(@"images\English.png"))
        {
            // Perform OCR to read the text from the input
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
Imports IronOcr

Class Program
    Shared Sub Main()
        ' Initialize the IronTesseract OCR engine
        Dim Ocr As New IronTesseract()

        ' Set the language to English
        Ocr.Language = OcrLanguage.English

        ' Define the input source as an image file
        Using Input As New OcrInput("images\English.png")
            ' Perform OCR to read the text from the input
            Dim Result = Ocr.Read(Input)

            ' Get all the recognized text
            Dim AllText = Result.Text

            ' Output the recognized text
            Console.WriteLine(AllText)
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel
  • Certifique-se de ter o pacote IronOCR e o pacote de idiomas apropriado instalados.
  • Este exemplo inicializa o mecanismo OCR, configura-o para processar inglês, lê texto de uma imagem de entrada e exibe o texto reconhecido.