Tonga OCR in C# and .NET
IronOCR은 .NET 개발자가 통가어를 포함한 126개 언어로 된 이미지와 PDF 문서에서 텍스트를 읽을 수 있도록 해주는 C# 소프트웨어 구성 요소입니다. 이는 .NET 개발자만을 위해 특별히 제작된 Tesseract의 고급 포크 버전으로, 속도와 정확성 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr.Languages.Tonga의 내용
이 패키지에는 통가어 전용 OCR 언어 모델 3개가 포함되어 있습니다.
- 통가
- 통가베스트
- 통가패스트
다운로드
통가어 언어 팩 [faka 통가어]
설치
Tonga OCR 기능을 사용하려면 다음 NuGet 명령을 사용하여 Tonga OCR 패키지를 .NET 프로젝트에 설치하십시오.
Install-Package IronOcr.Languages.Tonga
코드 예제
다음 C# 코드 예제는 IronOCR을 사용하여 이미지 또는 PDF 문서에서 통가어 텍스트를 읽는 방법을 보여줍니다.
// Include the necessary IronOcr namespace
using IronOcr;
class TongaOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine to use the Tonga language pack
Ocr.Language = OcrLanguage.Tonga;
// Load the input image or PDF into OcrInput
using (var Input = new OcrInput(@"images\Tonga.png"))
{
// Perform OCR to read the text from the image
var Result = Ocr.Read(Input);
// Retrieve the full text recognition result
var AllText = Result.Text;
// Output the result or process further as needed
System.Console.WriteLine(AllText);
}
}
}
// Include the necessary IronOcr namespace
using IronOcr;
class TongaOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine to use the Tonga language pack
Ocr.Language = OcrLanguage.Tonga;
// Load the input image or PDF into OcrInput
using (var Input = new OcrInput(@"images\Tonga.png"))
{
// Perform OCR to read the text from the image
var Result = Ocr.Read(Input);
// Retrieve the full text recognition result
var AllText = Result.Text;
// Output the result or process further as needed
System.Console.WriteLine(AllText);
}
}
}
' Include the necessary IronOcr namespace
Imports IronOcr
Friend Class TongaOcrExample
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR engine to use the Tonga language pack
Ocr.Language = OcrLanguage.Tonga
' Load the input image or PDF into OcrInput
Using Input = New OcrInput("images\Tonga.png")
' Perform OCR to read the text from the image
Dim Result = Ocr.Read(Input)
' Retrieve the full text recognition result
Dim AllText = Result.Text
' Output the result or process further as needed
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
- 이 코드 예제는 IronTesseract OCR 엔진을 초기화하고 통가어를 사용하도록 설정하는 방법을 보여줍니다.
- 지정된 경로에서 이미지를
OcrInput객체로 로드합니다. Ocr.Read()메서드는 입력을 처리하여 텍스트를 추출하고, 그런 다음Result.Text속성을 통해 인식된 텍스트를 가져옵니다.- 마지막으로, 추출된 텍스트는 응용 프로그램 내에서 필요에 따라 출력되거나 처리될 수 있습니다.

