Hangul Alphabet OCR in C# and .NET
Curtis Chau
更新: 2026年8月2日
IronOCR 是一个 C# 软件组件,允许 .NET 程序员从图像和 PDF 文档中读取 126 种语言的文本,包括韩文字母。
它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。
IronOcr.Languages.Hangul 的内容
此软件包包含 156 种适用于 .NET 的 OCR 语言:
- 한글알파벳
- 한글알파벳Best
- 한글알파벳Fast
- 韩文垂直字母
- 韩文垂直字母Best
- 韩文垂直字母Fast
下载
韩文字母语言包 [韩文字母]
安装
第一步是将韩文字母OCR 包安装到您的 .NET 项目中。
代码示例
此 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
Imports IronOcr
Module Program
Sub Main()
' Create a new instance of IronTesseract for performing OCR
Dim Ocr As 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 As 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 Module' Ensure the IronOCR library is installed
' PM> Install-Package IronOcr.Languages.Hangul
Imports IronOcr
Module Program
Sub Main()
' Create a new instance of IronTesseract for performing OCR
Dim Ocr As 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 As 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 Module说明:
- IronTesseract: 这是用于执行OCR操作的主要类。
- OcrLanguage.Hangul: 这指定了OCR引擎应使用韩国语言包,该包优化了引擎以识别韩文文本。
- OcrInput: 这是要处理的图像或PDF的容器。
Ocr.Read(): 该方法执行OCR操作并返回包含识别文本的结果对象。
Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。