Hangul Alphabet OCR in C# and .NET
IronOCR é um componente de software em C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o Alfabeto Hangul.
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.Hangul
Este pacote contém 156 idiomas de OCR for .NET:
- AlfabetoHangul
- AlfabetoHangulMelhor
- AlfabetoHangulRápido
- AlfabetoVerticalHangul
- AlfabetoVerticalHangulMelhor
- AlfabetoVerticalHangulRápido
Baixar
Pacote de Idioma do Alfabeto Hangul [Alfabeto Coreano]
Instalação
O primeiro passo é instalar o pacote OCR do Alfabeto Hangul no seu projeto .NET.
Install-Package IronOcr.Languages.Hangul
Exemplo de código
Este exemplo de código C# lê texto do Alfabeto Hangul de uma Imagem ou 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 Class
Explicação:
- IronTesseract : Esta é a classe principal usada para realizar operações de OCR.
- OcrLanguage.Hangul: Isso especifica que o mecanismo de OCR deve usar o pacote de idioma Hangul, que otimiza o motor para reconhecimento de texto coreano.
- OcrInput: Este é um contêiner para as imagens ou PDFs a serem processados.
- Ocr.Read(): Este método executa a operação de OCR e retorna um objeto de resultado contendo o texto reconhecido.

