Sinhala OCR in C# and .NET
이 문서의 다른 버전:
IronOCR은 .NET 개발자가 싱할라어를 포함한 126개 언어로 된 이미지와 PDF 문서에서 텍스트를 읽을 수 있도록 해주는 C# 소프트웨어 구성 요소입니다.
이는 .NET 개발자 전용으로 제작된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr의 내용.언어.싱할라어
이 패키지에는 .NET 용 OCR 언어 114개가 포함되어 있습니다.
- 싱할라어
- SinhalaBest
- SinhalaFast
- 싱할라어 알파벳
- 싱할라어알파벳베스트
- 싱할라어알파벳빠른
다운로드
싱할라어 언어 팩 [සංහල]
설치
먼저 .NET 프로젝트에 싱할라어 OCR 패키지를 설치해야 합니다.
Install-Package IronOcr.Languages.Sinhala
코드 예제
이 C# 코드 예제는 이미지 또는 PDF 문서에서 싱할라어 텍스트를 읽습니다.
// Import the IronOcr namespace
using IronOcr;
class SinhalaOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine to use the Sinhala language
Ocr.Language = OcrLanguage.Sinhala;
// Define the input image or PDF file
using (var Input = new OcrInput(@"images\Sinhala.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class SinhalaOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine to use the Sinhala language
Ocr.Language = OcrLanguage.Sinhala;
// Define the input image or PDF file
using (var Input = new OcrInput(@"images\Sinhala.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class SinhalaOcrExample
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR engine to use the Sinhala language
Ocr.Language = OcrLanguage.Sinhala
' Define the input image or PDF file
Using Input = New OcrInput("images\Sinhala.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
End Sub
End Class
설명:
- IronTesseract : 텍스트 인식을 위해 사용되는 주요 OCR 엔진 클래스입니다.
- 언어 : 인식할 텍스트의 언어를 지정합니다. 이 경우에는 싱할라어입니다.
- OcrInput : 텍스트 인식을 수행해야 하는 입력 파일(이미지 또는 PDF)을 나타냅니다.
- 읽기 : 입력 파일에 OCR 프로세스를 실행하고 인식된 텍스트를 반환합니다.
- Result.Text : 입력 파일에서 OCR로 인식된 텍스트를 포함하며, 이는 추가 처리 또는 표시용으로 사용할 수 있습니다.

