Latin Alphabet OCR in C# and .NET
IronOCR은 126개의 언어를 포함하여 라틴어 알파벳으로 이미지와 PDF 문서에서 텍스트를 읽을 수 있는 .NET 개발자용 C# 소프트웨어 구성 요소입니다.
이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr.Languages.LatinAlphabet의 내용
이 패키지에는 .NET용 OCR 언어 64개가 포함되어 있습니다.
- LatinAlphabet
- LatinAlphabetBest
- LatinAlphabetFast
다운로드
라틴어 알파벳 언어 팩 [latine]
설치
우리가 해야 할 첫 번째 일은 .NET 프로젝트에 Latin Alphabet OCR 패키지를 설치하는 것입니다.
Install-Package IronOcr.Languages.LatinAlphabet
코드 예제
이 C# 코드 예제는 이미지 또는 PDF 문서에서 라틴어 알파벳 텍스트를 읽습니다.
// Install the IronOCR.languages.LatinAlphabet package first
using IronOcr;
var Ocr = new IronTesseract(); // Initialize IronTesseract instance
// Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet;
// Define the input image or PDF you want to read
using (var Input = new OcrInput(@"images\LatinAlphabet.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
// Install the IronOCR.languages.LatinAlphabet package first
using IronOcr;
var Ocr = new IronTesseract(); // Initialize IronTesseract instance
// Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet;
// Define the input image or PDF you want to read
using (var Input = new OcrInput(@"images\LatinAlphabet.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
' Install the IronOCR.languages.LatinAlphabet package first
Imports IronOcr
Private Ocr = New IronTesseract() ' Initialize IronTesseract instance
' Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet
' Define the input image or PDF you want to read
Using Input = New OcrInput("images\LatinAlphabet.png")
' Perform OCR reading on the input
Dim Result = Ocr.Read(Input)
' Extract the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
설명
-
IronTesseract 초기화: OCR 처리를 담당할
IronTesseract인스턴스가 초기화됩니다. -
언어 설정: IronOCR 패키지에서 사용할 수 있는 언어 중 하나로 OCR 언어를
LatinAlphabet에 설정합니다. -
입력 사양: 텍스트를 추출할 이미지나 PDF 경로를 지정하는
OcrInput객체를 생성합니다. -
OCR 실행:
IronTesseract인스턴스의Read메서드를 호출하여OcrInput을 처리합니다. 이것은 추출된 텍스트를 포함하는Result객체를 반환합니다. -
텍스트 추출:
Result객체의Text속성을 사용하여 인식된 텍스트에 접근합니다. - 출력: 인식된 텍스트는 확인을 위해 콘솔에 출력됩니다.
OcrInput의 파일 경로가 파일을 찾을 수 없는 예외를 피하기 위해 이미지나 PDF 파일을 올바르게 가리키고 있는지 확인하세요.

