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
코드 설명:
- OCR을 수행하는 데 사용되는
IronTesseract의 새 인스턴스를 초기화합니다. - OCR 엔진의 언어는
OcrLanguage.Serbian을 사용하여 세르비아어로 설정되어 있습니다. Serbian.png이미지를OcrInput를 사용하여 로드합니다. 이 함수는 지정된 경로에서 파일을 읽어옵니다.- OCR 객체에서
Read함수를 호출하여 이미지를 처리하고 텍스트를 추출합니다. - 이미지에서 추출된 텍스트는
AllText변수에 저장된 후 콘솔에 PRINT됩니다.

