OCR portugais en C# et .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR est un composant logiciel C# permettant aux développeurs .NET de lire du texte à partir d'images et de documents PDF dans 126 langues, dont le portugais.

Il s'agit d'une version avancée de Tesseract, conçue exclusivement pour les développeurs .NET et qui surpasse régulièrement les autres moteurs Tesseract en termes de vitesse et de précision.

Contenu d'IronOcr.Langues.Portugais

Ce package contient 55 langues OCR pour .NET :

  • Portugais
  • PortugaisMeilleur
  • Portugais Rapide

Télécharger

Pack de langue portugaise

  • Télécharger au format Zip
  • Installer avec NuGet

Installation

La première chose à faire est d'installer notre package OCR portugais sur votre projet .NET.

Install-Package IronOCR.Languages.Portuguese

Exemple de code

Cet exemple de code C# lit du texte portugais à partir d'une image ou d'un document PDF.

// Required using directive for IronOcr
using IronOcr;

var Ocr = new IronTesseract();

// Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese;

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

    // Retrieve the recognized text
    var AllText = Result.Text;

    // Output the extracted text
    Console.WriteLine(AllText);
}
// Required using directive for IronOcr
using IronOcr;

var Ocr = new IronTesseract();

// Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese;

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

    // Retrieve the recognized text
    var AllText = Result.Text;

    // Output the extracted text
    Console.WriteLine(AllText);
}
' Required using directive for IronOcr
Imports IronOcr

Private Ocr = New IronTesseract()

' Specify the language for OCR as Portuguese
Ocr.Language = OcrLanguage.Portuguese

' Load the image or PDF from which to read the text
Using Input = New OcrInput("images\Portuguese.png")
	' Perform OCR on the input
	Dim Result = Ocr.Read(Input)

	' Retrieve the recognized text
	Dim AllText = Result.Text

	' Output the extracted text
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

Ce code montre comment configurer et utiliser la bibliothèque IronOCR pour lire du texte portugais à partir d'une image. Vérifiez que le chemin d'accès à l'image ou au document PDF est correct. Le texte reconnu sera stocké dans la variable AllText , puis affiché dans la console.