OCR espagnol 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 l'espagnol.

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 de IronOcr.Languages.Spanish

Ce package contient plusieurs options de langue OCR pour .NET :

  • Espagnol
  • SpanishBest
  • SpanishFast
  • Espagnol vieux
  • SpanishOldBest
  • Vieux-déjeuner espagnol

Télécharger

Pack de langue espagnole [español]

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

Installation

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

Install-Package IronOCR.Languages.Spanish

Exemple de code

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

// Import the IronOcr namespace
using IronOcr;

// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();

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

// Use a using block to manage the OcrInput resource
using (var Input = new OcrInput(@"images\Spanish.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

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

    // The 'AllText' variable now contains the Spanish text
}
// Import the IronOcr namespace
using IronOcr;

// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();

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

// Use a using block to manage the OcrInput resource
using (var Input = new OcrInput(@"images\Spanish.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

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

    // The 'AllText' variable now contains the Spanish text
}
' Import the IronOcr namespace
Imports IronOcr

' Create a new instance of the IronTesseract class
Private Ocr = New IronTesseract()

' Set the OCR language to Spanish
Ocr.Language = OcrLanguage.Spanish

' Use a using block to manage the OcrInput resource
Using Input = New OcrInput("images\Spanish.png")
	' Perform OCR on the input image
	Dim Result = Ocr.Read(Input)

	' Extract all text from the OCR result
	Dim AllText = Result.Text

	' The 'AllText' variable now contains the Spanish text
End Using
$vbLabelText   $csharpLabel

Le code ci-dessus montre comment utiliser la bibliothèque IronOCR pour lire et extraire du texte espagnol à partir d'un fichier image nommé Spanish.png . Veillez à inclure les espaces de noms nécessaires et à gérer les ressources de manière appropriée à l'aide de blocs using lorsque cela est nécessaire.