Serbian OCR in C# and .NET
이 문서의 다른 버전:
IronOCR은 .NET 개발자가 세르비아어를 포함한 126개 언어로 된 이미지와 PDF 문서에서 텍스트를 읽을 수 있도록 해주는 C# 소프트웨어 구성 요소입니다. 이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.
IronOcr.언어.세르비아어의 내용
이 패키지에는 .NET용 OCR 언어 105개가 포함되어 있습니다.
- 세르비아어
- 세르비아 최고
- 세르비아 패스트
- 세르비아어 라틴어
- 세르비아 라틴 베스트
- 세르비아 라틴 패스트
다운로드
세르비아어 언어 팩 [српски језик]
설치
먼저 해야 할 일은 세르비아어 OCR 패키지를 .NET 프로젝트에 설치하는 것입니다.
Install-Package IronOcr.Languages.Serbian
코드 예제
이 C# 코드 예제는 이미지 또는 PDF 문서에서 세르비아어 텍스트를 읽습니다.
// Ensure all necessary namespaces are imported
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Serbian
Ocr.Language = OcrLanguage.Serbian;
// Use a using statement to ensure resources are disposed properly
using (var Input = new OcrInput(@"images\Serbian.png"))
{
// Perform OCR and store the result
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the resulting text
Console.WriteLine(AllText);
}
}
}
// Ensure all necessary namespaces are imported
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of IronTesseract
var Ocr = new IronTesseract();
// Set the language to Serbian
Ocr.Language = OcrLanguage.Serbian;
// Use a using statement to ensure resources are disposed properly
using (var Input = new OcrInput(@"images\Serbian.png"))
{
// Perform OCR and store the result
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// Output the resulting text
Console.WriteLine(AllText);
}
}
}
' Ensure all necessary namespaces are imported
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of IronTesseract
Dim Ocr = New IronTesseract()
' Set the language to Serbian
Ocr.Language = OcrLanguage.Serbian
' Use a using statement to ensure resources are disposed properly
Using Input = New OcrInput("images\Serbian.png")
' Perform OCR and store the result
Dim Result = Ocr.Read(Input)
' Extract all text from the OCR result
Dim AllText = Result.Text
' Output the resulting text
Console.WriteLine(AllText)
End Using
End Sub
End Class
코드 설명:
IronTesseract의 새로운 인스턴스를 초기화하여 OCR을 수행합니다.- OCR 엔진의 언어를
OcrLanguage.Serbian을 사용하여 세르비아어로 설정합니다. - 지정을 사용하여
Serbian.png이미지를OcrInput로 로드하는데, 이는 지정된 경로에서 파일을 읽습니다. - OCR 객체에서 이미지 처리와 텍스트 추출을 위해
Read함수를 호출합니다. - 이미지에서 추출된 텍스트는 변수
AllText에 저장된 다음 콘솔에 출력됩니다.

