Bengali OCR in C# and .NET
이 문서의 다른 버전:
IronOCR 은 .NET 개발자가 벵골어를 포함한 126개 언어로 된 이미지와 PDF 문서에서 텍스트를 읽을 수 있도록 해주는 C# 소프트웨어 구성 요소입니다. 이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOCR 의 내용.언어.벵골어
이 패키지에는 .NET 용 OCR 언어 114개가 포함되어 있습니다.
- 벵골어
- 벵갈리베스트
- 벵골어 패스트
- 벵골어 알파벳
- 벵골어 알파벳 베스트
- 벵골어알파벳빠른
다운로드
벵골어 언어 팩 [방글라어]
설치
먼저 .NET 프로젝트에 벵골어 OCR 패키지를 설치해야 합니다.
Install-Package IronOcr.Languages.Bengali
코드 예제
이 C# 코드 예제는 이미지 또는 PDF 문서에서 벵골어 텍스트를 읽습니다.
// Import the IronOcr namespace
using IronOcr;
class BengaliOcrExample
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Specify the language for OCR
Ocr.Language = OcrLanguage.Bengali;
// Process the image and extract text
using (var Input = new OcrInput(@"images\Bengali.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Get the extracted text
var AllText = Result.Text;
// Output the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class BengaliOcrExample
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Specify the language for OCR
Ocr.Language = OcrLanguage.Bengali;
// Process the image and extract text
using (var Input = new OcrInput(@"images\Bengali.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Get the extracted text
var AllText = Result.Text;
// Output the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class BengaliOcrExample
Shared Sub Main()
' Create an instance of IronTesseract
Dim Ocr = New IronTesseract()
' Specify the language for OCR
Ocr.Language = OcrLanguage.Bengali
' Process the image and extract text
Using Input = New OcrInput("images\Bengali.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Get the extracted text
Dim AllText = Result.Text
' Output the extracted text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
설명
-
IronOcr 가져오기: OCR 작업을 수행하는 데 필요한 클래스와 메서드가 포함된
IronOcr네임스페이스를 가져오는 것으로 시작합니다. -
IronTesseract 인스턴스 생성: OCR을 수행하는 메인 클래스인
IronTesseract의 인스턴스를 생성합니다. -
언어 설정:
OcrLanguage.Bengali을 사용하여 OCR 언어를 벵골어로 설정합니다. -
OcrInput: 텍스트를 추출할 이미지의 경로를 지정합니다.
OcrInput객체는 입력 파일을 로드하고 전처리하는 데 사용됩니다. -
텍스트 읽기 및 추출:
Read메서드를 사용하여 이미지를 처리하여 텍스트 내용을 읽습니다. 텍스트는Result.Text에 저장됩니다. - 출력 텍스트: 마지막으로 추출된 텍스트를 콘솔에 출력하여 출력을 확인합니다.

