Latvian OCR in C# and .NET
이 문서의 다른 버전:
IronOCR은 126개의 언어를 포함하여 라트비아어로 이미지와 PDF 문서에서 텍스트를 읽을 수 있는 .NET 개발자용 C# 소프트웨어 구성 요소입니다.
이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr.Languages.Latvian의 내용
이 패키지에는 .NET용 OCR 언어 46개가 포함되어 있습니다.
- Latvian
- LatvianBest
- LatvianFast
다운로드
Latvian Language Pack [latviešu valoda]
설치
먼저 .NET 프로젝트에 Latvian OCR 패키지를 설치해야 합니다.
Install-Package IronOcr.Languages.Latvian
코드 예제
이 C# 코드 예제는 이미지나 PDF 문서에서 Latvian 텍스트를 읽습니다.
using IronOcr;
class LatvianOCRExample
{
static void Main()
{
// Create an instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian;
// Define the input image file path
using (var Input = new OcrInput(@"images\Latvian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}
using IronOcr;
class LatvianOCRExample
{
static void Main()
{
// Create an instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian;
// Define the input image file path
using (var Input = new OcrInput(@"images\Latvian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}
Imports IronOcr
Friend Class LatvianOCRExample
Shared Sub Main()
' Create an instance of IronTesseract for OCR
Dim Ocr = New IronTesseract()
' Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian
' Define the input image file path
Using Input = New OcrInput("images\Latvian.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the OCR result
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
설명
- IronOcr 네임스페이스: 예제는 OCR 기능에 접근하기 위해 필요한
IronOcr네임스페이스를 가져오는 것으로 시작합니다. - IronTesseract 인스턴스: 이미지를 읽고 텍스트를 추출하는 작업을 처리하기 위해
IronTesseract객체(Ocr)가 생성됩니다. - 언어 구성:
Ocr.Language속성을 설정하여 라트비아어 텍스트를 읽도록 OCR 프로세스를 구성합니다. - OcrInput 객체: 처리할 이미지 파일을 참조하는
OcrInput객체가 생성됩니다. - 이미지 읽기: 이미지 처리 및 텍스트 추출을 위해
Ocr인스턴스에서Read메서드를 호출하며, 결과는Result변수에 저장됩니다. - 결과 추출: OCR 결과는
Result.Text를 통해 접근되며, 추가적인 사용 또는 디스플레이를 위해AllText에 저장됩니다. - Console Output: 인식된 Latvian 텍스트는 텍스트 추출에 대한 시각적 확인을 제공하기 위해 콘솔에 출력됩니다.

