追加のOCR言語パック
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");
}Imports IronOcr
Private ocr = New IronTesseract()
' Set the OCR to use Chinese Simplified
ocr.Language = OcrLanguage.ChineseSimplified
Using 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
Dim result = ocr.Read(input)
' Store the recognized text in a string
Dim testResult As String = result.Text
' Save the recognized text to a file since the console might not display Unicode characters properly
result.SaveAsTextFile("chinese.txt")
End Using縦書き言語の例
縦書き言語向けに調整された辞書。 韓国語と日本語の 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);
}Imports IronOcr
Private ocr = New IronTesseract()
' Set the OCR to use Japanese Vertical language
ocr.Language = OcrLanguage.JapaneseVertical
Using input = New OcrInput("images\image.png")
' Process the image and get the OCR result
Dim result = ocr.Read(input)
' Output the recognized text to the console
Console.WriteLine(result.Text)
End Usingカスタム言語の例
ダウンロードした、または自分でトレーニングした 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);
}Imports IronOcr
Private ocr = New IronTesseract()
' Use a custom Tesseract language file
ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
Using input = New OcrInput("images\image.png")
' Process the image and get the OCR result
Dim result = ocr.Read(input)
' Output the recognized text to the console
Console.WriteLine(result.Text)
End Using複数言語の例
一度に複数の言語。
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);
}Imports IronOcr
Private 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 input = New OcrInput("images\multi-lang.pdf")
' Process the PDF and get the OCR result
Dim result = ocr.Read(input)
' Output the recognized text to the console
Console.WriteLine(result.Text)
End Usingより速い言語の例
速度を重視して調整された辞書。 任意の 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);
}Imports IronOcr
Private ocr = New IronTesseract()
' Set the OCR to use the fast variant of English
ocr.Language = OcrLanguage.EnglishFast
Using input = New OcrInput("images\image.png")
' Process the image and get the OCR result
Dim result = ocr.Read(input)
' Output the recognized text to the console
Console.WriteLine(result.Text)
End Usingより高精度な詳細言語の例
辞書は正確さを重視して調整されていますが、結果の表示速度ははるかに遅くなります。 任意の OcrLanguage の"ベスト"バリアントを使用します。
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);
}Imports IronOcr
Private ocr = New IronTesseract()
' Set the OCR to use the best variant of French
ocr.Language = OcrLanguage.FrenchBest
Using input = New OcrInput("images\image.png")
' Process the image and get the OCR result
Dim result = ocr.Read(input)
' Output the recognized text to the console
Console.WriteLine(result.Text)
End UsingOCR言語パックのインストール方法
追加の OCR 言語パックは以下からダウンロードできます。 どちらか
- NuGet パッケージをインストールします。 NuGet で IronOCR Languages を検索します。
または、"ocrdata"ファイルをダウンロードし、任意のフォルダにある.NETプロジェクトに追加します。CopyToOutputDirectory
CopyToOutputDirectory = CopyIfNewerを設定します。- または、"ocrdata"ファイルをダウンロードして、任意のフォルダにある .NET プロジェクトに追加してください。CopyToOutputDirectory を
CopyIfNewerに設定します。
- Ancient Greek Language Pack Ἑλληνική Zip NuGet
- Assamese Language Pack অসমীযা Zip NuGet
- Breton Language Pack brezhoneg Zip NuGet
- Canadian Aboriginal Alphabet Language Pack Canadian First Nations Zip NuGet
- Cebuano Language Pack Bisaya Zip NuGet
- Cherokee Language Pack ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ Zip NuGet
- Cyrillic Language Pack Cyrillic scripts Zip NuGet
- Devanagari Language Pack Nagair Zip NuGet
- Faroese Language Pack føroyskt Zip NuGet
- Filipino Language Pack The Philippines Zip NuGet
- Financial Language Pack Spreadsheets & Numbers Zip NuGet
- Fraktur Language Pack Generic Fraktur Zip NuGet
- Frankish Language Pack Frenkisk Zip NuGet
- Gurmukhi Alphabet Language Pack Gurmukhī Zip NuGet
- Hangul Language Pack Hangul Alphabet Zip NuGet
- Inuktitut Language Pack ᐃᓄᒃᑎᑐᑦ Zip NuGet
- Javanese Language Pack basa Jawa Zip NuGet
- Latin Alphabet Language Pack latine Zip NuGet
- Malay Language Pack bahasa Melayu Zip NuGet
- Malayalam Language Pack മലയാളം Zip NuGet
- Maori Language Pack te reo Māori Zip NuGet
- MICR Language Pack Magnetic Ink Character Recognition Zip NuGet
- Middle English Language Pack English (1100-1500 AD) Zip NuGet
- Middle French Language Pack Moyen Français Zip NuGet
- Myanmar Language Pack Burmese Zip NuGet
- Northern Kurdish Language Pack Kurmanji Zip NuGet
- Norwegian Language Pack Norsk Zip NuGet
- Occitan Language Pack occitan Zip NuGet
- Quechua Language Pack Runa Simi Zip NuGet
- Sanskrit Language Pack ससकतम Zip NuGet
- Scottish Gaelic Language Pack Gàidhlig Zip NuGet
- Syriac Language Pack Syrian Zip NuGet
- Tibetan Language Pack Tibetan Standard Zip NuGet
- Tonga Language Pack faka Tonga Zip NuGet
ヘルプ
読みたい言語が上記のリストにない場合は、お問い合わせください。 リクエストに応じて他の多くの言語も利用可能です。
制作リソースは IronOCR ライセンシーに優先的に提供されるため、希望する言語パックにアクセスするために IronOCR のライセンスもご検討ください。





