Hangul Alphabet OCR in C# and .NET
IronOCR는 .NET 프로그래머가 한글을 포함하여 126개 언어로 이미지 및 PDF 문서에서 텍스트를 읽을 수 있게 하는 C# 소프트웨어 구성 요소입니다.
이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr.Languages.Hangul의 내용
이 패키지는 .NET를 위한 156개의 OCR 언어를 포함합니다:
- HangulAlphabet
- HangulAlphabetBest
- HangulAlphabetFast
- HangulVerticalAlphabet
- HangulVerticalAlphabetBest
- HangulVerticalAlphabetFast
다운로드
한글 알파벳 언어 팩 [한국어 알파벳]
설치
첫 번째 단계는 .NET 프로젝트에 Hangul Alphabet OCR 패키지를 설치하는 것입니다.
Install-Package IronOcr.Languages.Hangul
코드 예제
이 C# 코드 예제는 이미지나 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
설명:
- IronTesseract : OCR 작업을 수행하는 데 사용되는 주요 클래스입니다.
- OcrLanguage.Hangul: 이는 OCR 엔진이 한글 언어 팩을 사용하도록 지정하며, 이는 한국어 텍스트 인식을 최적화합니다.
- OcrInput: 이는 처리할 이미지나 PDF를 담는 컨테이너입니다.
- Ocr.Read(): 이 메서드는 OCR 작업을 수행하고 인식된 텍스트를 포함하는 결과 객체를 반환합니다.

