Italian OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
이 문서의 다른 버전:

IronOCR은 .NET 개발자가 이미지 및 PDF 문서에서 126개의 언어, 포함된 이탈리안을 읽을 수 있게 하는 C# 소프트웨어 구성 요소입니다.

이는 .NET 개발자 전용으로 개발된 Tesseract의 고급 포크 버전으로, 속도와 정확도 면에서 다른 Tesseract 엔진보다 뛰어난 성능을 보여줍니다.

IronOcr.Languages.Italian의 내용

이 패키지는 .NET을 위한 6개의 OCR 언어 모드를 포함하고 있습니다:

  • 이탈리안
  • ItalianBest
  • ItalianFast
  • ItalianOld
  • ItalianOldBest
  • ItalianOldFast

다운로드

이탈리안 언어 팩 [italiano]

설치

우리가 해야 할 첫 번째 일은 귀하의 .NET 프로젝트에 이탈리안 OCR 패키지를 설치하는 것입니다.

Install-Package IronOcr.Languages.Italian

코드 예제

이 C# 코드 예제는 이미지나 PDF 문서에서 이탈리안 텍스트를 읽습니다.

// Include IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Set the OCR language to Italian
        Ocr.Language = OcrLanguage.Italian;

        // Read text from an image file
        using (var Input = new OcrInput(@"images\Italian.png"))
        {
            // Perform OCR to get the text content from the image
            var Result = Ocr.Read(Input);

            // Get and print all the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
// Include IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Set the OCR language to Italian
        Ocr.Language = OcrLanguage.Italian;

        // Read text from an image file
        using (var Input = new OcrInput(@"images\Italian.png"))
        {
            // Perform OCR to get the text content from the image
            var Result = Ocr.Read(Input);

            // Get and print all the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

설명:

  1. IronOCR 사용하기: IronOcr 라이브러리가 OCR 기능을 활용하기 위해 포함됩니다.
  2. IronTesseract 인스턴스 생성: IronTesseract는 OCR 처리를 위해 사용되는 핵심 클래스입니다.
  3. 언어 설정: Ocr.Language = OcrLanguage.Italian를 사용하여 이탈리아어를 처리하도록 OCR을 설정합니다.
  4. 입력 읽기: 이미지 파일을 지정하기 위해 OcrInput 객체가 생성됩니다.
  5. OCR 수행: Ocr.Read(Input)가 입력 이미지에서 OCR 프로세스를 실행하고 텍스트 결과를 반환합니다.
  6. 출력: 생성된 텍스트는 AllText에 저장되고 콘솔에 표시됩니다.

예제가 제대로 작동하려면 images\Italian.png 파일 경로가 올바르며 파일이 존재하는지 확인하세요.