OCR del alfabeto Hangul en C# y .NET
IronOCR es un componente de software C# que permite a los programadores de .NET leer texto de imágenes y documentos PDF en 126 idiomas, incluido el alfabeto Hangul.
Es una versión avanzada de Tesseract, construida exclusivamente para desarrolladores de .NET y que supera regularmente a otros motores Tesseract tanto en velocidad como en precisión.
Contenido de IronOcr.Languages.Hangul
Este paquete contiene 156 idiomas OCR para .NET:
- HangulAlphabet
- HangulAlphabetBest
- HangulAlphabetFast
- HangulVerticalAlphabet
- HangulVerticalAlphabetBest
- HangulVerticalAlphabetFast
Descargar
Paquete de idioma del alfabeto Hangul [Alfabeto coreano]
Instalación
El primer paso es instalar el paquete OCR del Alfabeto Hangul en su proyecto .NET.
Install-Package IronOCR.Languages.Hangul
Ejemplo de código
Este ejemplo de código C# lee texto del alfabeto Hangul desde una imagen o documento PDF.
// Ensure the IronOCR library is installed
// PM> Install-Package IronOcr.Languages.Hangul
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract for performing OCR
var Ocr = new IronTesseract();
// Specify the Hangul language pack for better accuracy with Korean texts
Ocr.Language = OcrLanguage.Hangul;
// Load the image or PDF you want to read
using (var Input = new OcrInput(@"images\Hangul.png"))
{
// Perform OCR to read the text from the image
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the text to the console
Console.WriteLine(AllText);
}
}
}// Ensure the IronOCR library is installed
// PM> Install-Package IronOcr.Languages.Hangul
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract for performing OCR
var Ocr = new IronTesseract();
// Specify the Hangul language pack for better accuracy with Korean texts
Ocr.Language = OcrLanguage.Hangul;
// Load the image or PDF you want to read
using (var Input = new OcrInput(@"images\Hangul.png"))
{
// Perform OCR to read the text from the image
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the text to the console
Console.WriteLine(AllText);
}
}
}' Ensure the IronOCR library is installed
' PM> Install-Package IronOcr.Languages.Hangul
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of IronTesseract for performing OCR
Dim Ocr = New IronTesseract()
' Specify the Hangul language pack for better accuracy with Korean texts
Ocr.Language = OcrLanguage.Hangul
' Load the image or PDF you want to read
Using Input = New OcrInput("images\Hangul.png")
' Perform OCR to read the text from the image
Dim Result = Ocr.Read(Input)
' Extract the recognized text
Dim AllText = Result.Text
' Output the text to the console
Console.WriteLine(AllText)
End Using
End Sub
End ClassExplicación:
- IronTesseract: Esta es la clase principal utilizada para realizar operaciones OCR.
- OcrLanguage.Hangul: Esto especifica que el motor OCR debe usar el paquete de idioma Hangul, lo que optimiza el motor para el reconocimiento de texto en coreano.
- OcrInput: Esto es un contenedor para las imágenes o PDFs que se procesarán.
- Ocr.Read(): Este método realiza la operación OCR y devuelve un objeto de resultado que contiene el texto reconocido.





