Lao OCR in C# and .NET
이 문서의 다른 버전:
IronOCR는 .NET 코드 작성자가 라오를 포함한 126개 언어에서 이미지 및 PDF 문서에서 텍스트를 읽을 수 있도록 하는 C# 소프트웨어 구성 요소입니다.
이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr.Languages.Lao의 내용물
이 패키지는 .NET용 여러 OCR 언어 모델을 포함합니다:
- 라오
- 라오베스트
- 라오빠르지
- 라오알파벳
- 라오알파벳베스트
- 라오알파벳빠르지
다운로드
라오 언어 팩 [ພາສາລາວ]
설치
우리가 해야 할 첫 번째 일은 .NET 프로젝트에 Lao OCR 패키지를 설치하는 것입니다.
Install-Package IronOcr.Languages.Lao
코드 예제
이 C# 코드 예제는 이미지 또는 PDF 문서에서 Lao 텍스트를 읽습니다.
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;
// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the recognized text for verification
Console.WriteLine(AllText);
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;
// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;
// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the recognized text for verification
Console.WriteLine(AllText);
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr
' Create a new IronTesseract instance
Private Ocr = New IronTesseract()
' Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao
' Use a using statement to ensure proper disposal of resources
Using Input = New OcrInput("images\Lao.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract all text from the OCR result
Dim AllText = Result.Text
' Output the recognized text for verification
Console.WriteLine(AllText)
End Using
설명:
- 이 코드는 IronOCR을 구성하고 라오어 언어에 대해 OCR을 수행하는 방법을 보여줍니다.
IronTesseract클래스는 OCR 작업을 수행하는 데 사용되는 주요 클래스입니다.- 언어는
Ocr.Language을 사용하여 라오어로 설정됩니다. OcrInput클래스는 OCR 처리를 위해 이미지 또는 PDF 문서를 로드하는 데 사용됩니다.Ocr.Read메서드는 입력을 처리하고 인식된 텍스트가 포함된 결과를 반환합니다.using구문은 사용 후 리소스가 해제되도록 보장합니다.- 마지막으로 인식된 텍스트가 출력을 확인하기 위해 콘솔에 인쇄됩니다.

