IronOCR에서 OCR 언어 팩을 사용하는 방법

추가 OCR 언어 팩

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronOCR은 125개의 국제 언어를 지원하지만, IronOCR에 기본적으로 설치된 언어는 영어뿐입니다.

추가 언어 팩은 NuGet 또는 다운로드하여 프로젝트 참조로 추가할 수 있는 DLL로 쉽게 C#, VB 또는 ASP .NET 프로젝트에 추가할 수 있습니다.

코드 예제

국제 언어 예제

Install-Package IronOcr.Languages.ChineseSimplified
using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use Chinese Simplified
ocr.Language = OcrLanguage.ChineseSimplified;

using (var input = new OcrInput())
{
    // Add an image to be processed
    input.AddImage("img/chinese.gif");

    // Optional: Enhance the input by deskewing or denoising the image
    // input.Deskew();
    // input.DeNoise();

    // Process the image and retrieve the result
    var result = ocr.Read(input);

    // Store the recognized text in a string
    string testResult = result.Text;

    // Save the recognized text to a file since the console might not display Unicode characters properly
    result.SaveAsTextFile("chinese.txt");
}
using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use Chinese Simplified
ocr.Language = OcrLanguage.ChineseSimplified;

using (var input = new OcrInput())
{
    // Add an image to be processed
    input.AddImage("img/chinese.gif");

    // Optional: Enhance the input by deskewing or denoising the image
    // input.Deskew();
    // input.DeNoise();

    // Process the image and retrieve the result
    var result = ocr.Read(input);

    // Store the recognized text in a string
    string testResult = result.Text;

    // Save the recognized text to a file since the console might not display Unicode characters properly
    result.SaveAsTextFile("chinese.txt");
}
$vbLabelText   $csharpLabel

세로로 쓰여진 언어 예제

세로로 쓰여진 언어를 위한 조정된 사전. 한국어 및 일본어 OcrLanguage의 '세로' 변형 사용.

using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use Japanese Vertical language
ocr.Language = OcrLanguage.JapaneseVertical;

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use Japanese Vertical language
ocr.Language = OcrLanguage.JapaneseVertical;

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
$vbLabelText   $csharpLabel

사용자 정의 언어 예제

다운로드하거나 직접 학습한 Tesseract .traineddata 언어 파일을 사용하기 위해.

using IronOcr;

var ocr = new IronTesseract();

// Use a custom Tesseract language file
ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
using IronOcr;

var ocr = new IronTesseract();

// Use a custom Tesseract language file
ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
$vbLabelText   $csharpLabel

다국어 예시

한 번에 하나 이상의 언어.

Install-Package IronOcr.Languages.Arabic
using IronOcr;

var ocr = new IronTesseract();

// Set the primary language to English
ocr.Language = OcrLanguage.English;
// Add Arabic as a secondary language
ocr.AddSecondaryLanguage(OcrLanguage.Arabic);
// Add any number of languages

using (var input = new OcrInput(@"images\multi-lang.pdf"))
{
    // Process the PDF and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
using IronOcr;

var ocr = new IronTesseract();

// Set the primary language to English
ocr.Language = OcrLanguage.English;
// Add Arabic as a secondary language
ocr.AddSecondaryLanguage(OcrLanguage.Arabic);
// Add any number of languages

using (var input = new OcrInput(@"images\multi-lang.pdf"))
{
    // Process the PDF and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
$vbLabelText   $csharpLabel

더 빠른 언어 예제

속도에 맞춰 조정된 사전. 모든 OcrLanguage의 '빠른' 변형 사용.

using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use the fast variant of English
ocr.Language = OcrLanguage.EnglishFast;

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use the fast variant of English
ocr.Language = OcrLanguage.EnglishFast;

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
$vbLabelText   $csharpLabel

더 높은 정확도 디테일 언어 예제

정확성을 위해 조정된 사전이지만 결과가 훨씬 느립니다. OcrLanguage의 'Best' 변형을 사용하세요.

Install-Package IronOcr.Languages.French
using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use the best variant of French
ocr.Language = OcrLanguage.FrenchBest;

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
using IronOcr;

var ocr = new IronTesseract();
// Set the OCR to use the best variant of French
ocr.Language = OcrLanguage.FrenchBest;

using (var input = new OcrInput(@"images\image.png"))
{
    // Process the image and get the OCR result
    var result = ocr.Read(input);
    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
$vbLabelText   $csharpLabel

OCR 언어 팩 설치 방법

추가 OCR 언어 팩은 아래에서 다운로드할 수 있습니다. 둘 중 하나

  • NuGet 패키지를 설치하세요. IronOcr 언어에 대한 NuGet 검색.
  • 또는 "ocrdata" 파일을 다운로드하여 원하는 폴더에 .NET 프로젝트에 추가하세요. CopyToOutputDirectory = CopyIfNewer 설정

OCR 언어 팩 다운로드

도움말

위 목록에서 읽고자 하는 언어를 찾을 수 없으면, 저희에게 연락처를 통해 문의하세요. 다른 언어들은 요청에 따라 제공됩니다.

IronOCR 라이선스 사용자에게 생산 리소스의 우선권이 있으므로, 원하는 언어 팩에 접근할 수 있도록 IronOCR 라이선스도 고려해 보세요.