高度な読み取りのためのOCR設定
IronOCRは標準的なOCRを超えたReadPassport、ReadLicensePlate、ReadPhotoなどの高度なスキャンリーディングメソッドを提供します。 これらの方法は IronOcr.Extensions.AdvancedScan パッケージによって強化されています。 これらの方法がテキストを処理する方法を微調整するために、IronOCR は開発者に文字のホワイトリスト、ブラックリスト、バーコード検出、データテーブルの読み取りなどを完全に制御できる TesseractConfiguration クラスを公開しています。
この記事では、高度な読み取りに利用できる TesseractConfiguration プロパティと、実際のシナリオで OCR を設定するための実用的な例を紹介します。
Read を呼び出す前に、WhiteListCharacters を TesseractConfiguration に設定します。 ホワイトリストに含まれていない文字はすべて結果から自動的に削除され、後処理なしでノイズが除去されます。
-
1IronOCR を NuGet Package Manager でインストールします
-
2このコード スニペットをコピーして実行します。
var input = new OcrInput(); input.LoadImage("image.png"); var result = new IronTesseract() { Configuration = new TesseractConfiguration { WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- " } }.Read(input); Console.WriteLine(result.Text);Dim input As New OcrInput() input.LoadImage("image.png") Dim result As New IronTesseract() With { .Configuration = New TesseractConfiguration With { .WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- " } }.Read(input) Console.WriteLine(result.Text)Dim input As New OcrInput() input.LoadImage("image.png") Dim result As New IronTesseract() With { .Configuration = New TesseractConfiguration With { .WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- " } }.Read(input) Console.WriteLine(result.Text) -
3実際の環境でテストするためにデプロイする
今日からご自身のプロジェクトでIronOCRを使い始めるには、無料トライアルをお試しください。
高度な読み取りのためのOCRの設定方法
- NuGet から IronOCR をインストール
- IronOcr.Extensions.AdvancedScan パッケージをインストール
TesseractConfigurationのプロパティ、例えばWhiteListCharactersとReadBarCodesを設定しますOcrInputを使用して入力画像を読み込みます- 高度なメソッド
ReadPhoto、ReadLicensePlate、またはReadPassportを使用して画像を読み取ります
TesseractConfigurationプロパティ
TesseractConfiguration クラスは OCR の動作をカスタマイズするための次のプロパティを提供します。 これらは IronTesseract.Configuration を通して設定されます。
| プロパティ | タイプ | 翻訳内容 |
|---|---|---|
WhiteListCharacters | 文字列 | この文字列に含まれる文字のみがOCR出力で認識されます。他のすべての文字は除外されます。 |
BlackListCharacters | 文字列 | この文字列に含まれる文字は積極的に無視され、OCR出力から除去されます。 |
ReadBarCodes | ブール | OCR処理中にドキュメント内のバーコードを検出するかどうかを有効/無効にします。 |
ReadDataTables | ブール | Tesseractを使用してドキュメント内のテーブル構造を検出するかどうかを有効/無効にします。 |
PageSegmentationMode | TesseractPageSegmentationMode | Tesseractが入力画像をどのようにセグメント化するかを決定します。オプションにはAutoOsd、Auto、SingleBlock、SingleLine、SingleWordなどがあります。 |
RenderSearchablePdf | ブール | 有効にすると、OCR出力は見えないテキスト層を持つ検索可能なPDFとして保存できます。 |
RenderHocr | ブール | 有効にすると、OCR出力にさらなる処理またはエクスポートのためのhOCRデータが含まれます。 |
TesseractVariables | Dictionary<文字列, object> | きめ細かい制御のための低レベルの Tesseract 構成変数への直接アクセスを提供します。 |
TesseractVariables 辞書は、さらに多くの Tesseract エンジンの基礎パラメータを公開し、高レベルのプロパティでは十分でない場合に対応します。
以下の例では、文字ホワイトリスト化から始めて、各プロパティグループについて説明します。
ナンバープレートのためのキャラクターホワイトリストの設定
WhiteListCharacters の一般的な使用例は、ナンバープレートに現れる可能性のある文字だけに OCR 出力を制限することです:大文字、数字、ハイフン、スペース。 予想される文字セット外のものをエンジンに無視させることによってノイズを除去し、精度を向上させます。
入力
以下の車両登録記録には、大文字テキスト、小文字テキスト、特殊記号(@、$、#、|、~、^、*)、および句読点が含まれています。

BlackListCharactersはホワイトリストを補完し、``,~, @, #, $, %, &, and *`のような既知のノイズ記号を積極的に除外します。
using IronOcr;
// Initialize the Tesseract OCR engine
IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
// Whitelist only characters that appear on license plates
WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- ",
// Blacklist common noise characters
BlackListCharacters = "`~@#$%&*",
};
var ocrInput = new OcrInput();
// Load the input image
ocrInput.LoadImage("advanced-input.png");
// Perform OCR on the input image with ReadPhoto method
var results = ocr.ReadPhoto(ocrInput);
// Print the filtered text result to the console
Console.WriteLine(results.Text);using IronOcr;
// Initialize the Tesseract OCR engine
IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
// Whitelist only characters that appear on license plates
WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- ",
// Blacklist common noise characters
BlackListCharacters = "`~@#$%&*",
};
var ocrInput = new OcrInput();
// Load the input image
ocrInput.LoadImage("advanced-input.png");
// Perform OCR on the input image with ReadPhoto method
var results = ocr.ReadPhoto(ocrInput);
// Print the filtered text result to the console
Console.WriteLine(results.Text);Imports IronOcr
' Initialize the Tesseract OCR engine
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
' Whitelist only characters that appear on license plates
.WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- ",
' Blacklist common noise characters
.BlackListCharacters = "`~@#$%&*"
}
Dim ocrInput As New OcrInput()
' Load the input image
ocrInput.LoadImage("advanced-input.png")
' Perform OCR on the input image with ReadPhoto method
Dim results = ocr.ReadPhoto(ocrInput)
' Print the filtered text result to the console
Console.WriteLine(results.Text)Imports IronOcr
' Initialize the Tesseract OCR engine
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
' Whitelist only characters that appear on license plates
.WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- ",
' Blacklist common noise characters
.BlackListCharacters = "`~@#$%&*"
}
Dim ocrInput As New OcrInput()
' Load the input image
ocrInput.LoadImage("advanced-input.png")
' Perform OCR on the input image with ReadPhoto method
Dim results = ocr.ReadPhoto(ocrInput)
' Print the filtered text result to the console
Console.WriteLine(results.Text)出力

結果にホワイトリストフィルタリングが明確に見えます:
- "Plate: ABC-1234" は "P ABC-1234" になります。 小文字の単語 "late:" は省略され、プレート番号は正確に保持されます。
- "VIN: 1HGBH41JXMN109186" は "VIN 1HGBH41JXMN109186" になります。 コロンは省略されますが、大文字のVINと完全な番号は保持されます。
- "Owner: john.doe@email.com" は "O" になります。 メール全体の小文字と句読点が削除されます。
- "Region: CA-90210 | Zone #5" は "R CA-90210 Z 5" になります。 パイプ (
|) とハッシュ (#) は削除され、大文字と数字は残ります。 - "Fee: $125.00 + tax"* は "F 12500" になります。 ドル記号、小数点、プラス記号、および小文字の "tax" はすべて削除されます。
- "Ref: ~record_v2^final" は "R 2" になります。 チルダ (
~)、アンダースコア、キャレット (^)、およびすべての小文字の文字は除去されます。
同じ WhiteListCharacters および BlackListCharacters アプローチは、ナンバープレートだけでなく、あらゆる文書タイプに対して機能します。 次のセクションでは、読み取り処理を拡張して、同じパスでバーコードとテーブル構造を検出する方法を示します。
バーコードとデータテーブルの読み取りを設定
IronOCRは、テキストと一緒にドキュメント内のバーコードおよび構造化テーブルを検出できます。 これらの機能は TesseractConfiguration を通じて制御されます:
IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
// Enable barcode detection within documents
ReadBarCodes = true,
// Enable table structure detection
ReadDataTables = true,
};IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
// Enable barcode detection within documents
ReadBarCodes = true,
// Enable table structure detection
ReadDataTables = true,
};Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.ReadBarCodes = True,
.ReadDataTables = True
}Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.ReadBarCodes = True,
.ReadDataTables = True
}- ReadBarCodes:
trueに設定すると、IronOCR はテキストに加えて、バーコードを文書内でスキャンします。 バーコードが予想されない場合、バーコード検出をスキップし、処理速度を上げるためにfalseに設定します。 - ReadDataTables:
trueに設定すると、Tesseract は文書内のテーブル構造を検出して保持しようとします。 これは請求書、レポート、その他の表形式のドキュメントに役立ちます。
これらのオプションは WhiteListCharacters と BlackListCharacters と組み合わせて、複雑な文書から抽出されるものを詳細に制御できます。
フィルタリングと検出は抽出対象を制御するものであり、レイアウトの解釈は別の問題である。 次のセクションでは、文書タイプに合った PageSegmentationMode を選択する方法を説明します。
ページセグメンテーションモードの制御
PageSegmentationMode は、認識前に入力画像をどのようにセグメント化するかを Tesseract に指示します。 特定のレイアウトに対して誤ったモードを選択すると、エンジンがテキストを誤って読み取ったり、完全にスキップしたりする原因となります。
| モード | 使用例 |
|---|---|
AutoOsd | 自動レイアウト分析と方向とスクリプト検出 |
Auto | OSDなしの自動レイアウト分析(デフォルト) |
SingleColumn | 画像が単一のテキスト列であると仮定します |
SingleBlock | 画像が単一の均一なテキストブロックであると仮定します |
SingleLine | 画像が単一のテキスト行であると仮定します |
SparseText | 任意の順序で可能な限り多くのテキストを発見します |
単一行を含むラベルやバナーの場合、SingleLine はマルチブロック解析を排除し、速度と精度の両方を向上させます。
入力
single-line-label.png は、SHIPPING LABEL: TRK-2024-XR9-001 を含む1行の太字 Courier テキストを持つ狭い発送ラベルです。

IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
PageSegmentationMode = TesseractPageSegmentationMode.SingleLine,
};
using OcrInput input = new OcrInput();
input.LoadImage("single-line-label.png");
OcrResult result = ocr.Read(input);
Console.WriteLine(result.Text);IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
PageSegmentationMode = TesseractPageSegmentationMode.SingleLine,
};
using OcrInput input = new OcrInput();
input.LoadImage("single-line-label.png");
OcrResult result = ocr.Read(input);
Console.WriteLine(result.Text);Imports IronOcr
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine
}
Using input As New OcrInput()
input.LoadImage("single-line-label.png")
Dim result As OcrResult = ocr.Read(input)
Console.WriteLine(result.Text)
End UsingImports IronOcr
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine
}
Using input As New OcrInput()
input.LoadImage("single-line-label.png")
Dim result As OcrResult = ocr.Read(input)
Console.WriteLine(result.Text)
End Using不規則なテキスト配置のスキャンされたページの場合、SparseText は Auto よりも多くのコンテンツを回収します。
入力
receipt-scan.png は、4つの項目(コーヒー、マフィン、ジュース、グラノーラバー)、ダッシュで区切られた仕切り、小計、税、および合計を持つ Corner Market のレシートです。 これは、固定ブロック分割では水平方向の異なる位置にあるエントリが欠落してしまうタイプのレイアウトです。

IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
PageSegmentationMode = TesseractPageSegmentationMode.SparseText,
};
using OcrInput input = new OcrInput();
input.LoadImage("receipt-scan.png");
OcrResult result = ocr.Read(input);
Console.WriteLine(result.Text);IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
PageSegmentationMode = TesseractPageSegmentationMode.SparseText,
};
using OcrInput input = new OcrInput();
input.LoadImage("receipt-scan.png");
OcrResult result = ocr.Read(input);
Console.WriteLine(result.Text);Imports IronTesseract
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.PageSegmentationMode = TesseractPageSegmentationMode.SparseText
}
Using input As New OcrInput()
input.LoadImage("receipt-scan.png")
Dim result As OcrResult = ocr.Read(input)
Console.WriteLine(result.Text)
End UsingImports IronTesseract
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.PageSegmentationMode = TesseractPageSegmentationMode.SparseText
}
Using input As New OcrInput()
input.LoadImage("receipt-scan.png")
Dim result As OcrResult = ocr.Read(input)
Console.WriteLine(result.Text)
End Usingドキュメントの種類に合わせてレイアウト分割を調整したら、次のステップは後続処理のための出力フォーマットを制御することです。
検索可能なPDFおよびhOCR出力を生成
RenderSearchablePdf と RenderHocr は、IronOCR がプレーンテキスト結果に加えて生成する出力形式を制御します。
RenderSearchablePdf は、元の画像の上に見えないテキストレイヤーを埋め込み、スキャン画像が表示されたままで、ユーザーが検索したりコピーしたりできる PDF を生成します。 これはドキュメントアーカイブワークフローの標準出力形式です。
入力
scanned-document.pdf は、IronOCR Solutions Ltd.からの日付15 March 2024の1ページのビジネスレターです(リファレンス DOC-2024-OCR-0315)。 結果は searchable-output.pdf として保存されます。
IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
RenderSearchablePdf = true,
};
using OcrInput input = new OcrInput();
input.LoadPdf("scanned-document.pdf");
OcrResult result = ocr.Read(input);
result.SaveAsSearchablePdf("searchable-output.pdf");IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
RenderSearchablePdf = true,
};
using OcrInput input = new OcrInput();
input.LoadPdf("scanned-document.pdf");
OcrResult result = ocr.Read(input);
result.SaveAsSearchablePdf("searchable-output.pdf");Imports IronTesseract
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.RenderSearchablePdf = True
}
Using input As New OcrInput()
input.LoadPdf("scanned-document.pdf")
Dim result As OcrResult = ocr.Read(input)
result.SaveAsSearchablePdf("searchable-output.pdf")
End UsingImports IronTesseract
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.RenderSearchablePdf = True
}
Using input As New OcrInput()
input.LoadPdf("scanned-document.pdf")
Dim result As OcrResult = ocr.Read(input)
result.SaveAsSearchablePdf("searchable-output.pdf")
End Using出力
出力は入力と見た目は全く同じですが、非表示のテキストレイヤーを含むPDFファイルです。 searchable-output.pdf を開いて、Ctrl+Fを使用して、埋め込まれたテキストが検索可能でコピー可能であることを確認します。
RenderHocr は、テキストコンテンツとそのすべての単語のバウンディングボックス座標をエンコードする HTML ファイルである hOCR ドキュメントを生成します。 これは、例えば墨消しエンジンや文書レイアウト分析など、下流のツールで単語の正確な位置決めが必要な場合に役立ちます。
入力
document-page.png は、ヘッディング「Quarterly Summary Q1 2024」と、収益、運営コスト、成長要因を含む財務データの2つの段落を持つ文書ページです。 結果は output.html として保存されます。

IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
RenderHocr = true,
};
using OcrInput input = new OcrInput();
input.LoadImage("document-page.png");
OcrResult result = ocr.Read(input);
result.SaveAsHocrFile("output.html");IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
RenderHocr = true,
};
using OcrInput input = new OcrInput();
input.LoadImage("document-page.png");
OcrResult result = ocr.Read(input);
result.SaveAsHocrFile("output.html");Imports IronOcr
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.RenderHocr = True
}
Using input As New OcrInput()
input.LoadImage("document-page.png")
Dim result As OcrResult = ocr.Read(input)
result.SaveAsHocrFile("output.html")
End UsingImports IronOcr
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.RenderHocr = True
}
Using input As New OcrInput()
input.LoadImage("document-page.png")
Dim result As OcrResult = ocr.Read(input)
result.SaveAsHocrFile("output.html")
End Using出力
output.html は、そのバウンディングボックス座標で認識された各単語をエンコードします。 ファイルをブラウザで開いてhOCR構造を検査するか、レイアウト解析や墨消しのために下流のツールに渡してください。
すべての3つの出力形式(プレーンテキスト、検索可能なPDF、およびhOCR)を単一の読み取り呼び出しから取得する必要がある場合、両方のフラグを同時に有効にすることができます。
これらの出力フラグは、ラテン文字以外の文字体系を含む、読み込まれる言語に関係なく機能します。次のセクションでは、日本語テキストに文字フィルタリングを適用する方法を示します。
国際文書向けUnicode文字フィルタリング
中国語、日本語、韓国語の国際文書の場合、WhiteListCharacters と BlackListCharacters プロパティは Unicode 文字で動作します。 これにより、日本語でひらがなとカタカナのみのスクリプトに出力を制限することが可能になります。
入力
文書には、タイトル (テスト)、濁点の異体字 (プ、デ) を含むひらがなとカタカナの混合日本語文、ブラックリストに登録されたノイズ記号 (★、■) と漢字 (価格) を含む価格行、およびブラックリストに登録された別の記号 (§)、追加の漢字 (購入)、追加の濁点の異体字 (プ、デ)、および基本カタカナ (メモ、アール) を含むメモ行が含まれています。 ホワイトリストでは、基本ひらがな、基本カタカナ、数字、および一般的な日本語の句読点のみが通過します。 3つの騒音シンボルは明確にブラックリストに登録されている。

ひらがなとカタカナの Unicode 文字範囲は、文字列リテラルとして WhiteListCharacters で渡され、ノイズ記号は BlackListCharacters にリストされています。
using IronOcr;
using System.IO;
IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
// Whitelist only Hiragana, Katakana, numbers, and common Japanese punctuation
WhiteListCharacters = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" +
"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン" +
"0123456789、。?!()¥ー",
// Blacklist common noise/symbols you want to ignore
BlackListCharacters = "★■§",
};
var ocrInput = new OcrInput();
// Load Japanese input image
ocrInput.LoadImage("jp.png");
// Perform OCR on the input image with ReadPhoto method
var results = ocr.ReadPhoto(ocrInput);
// Write the text result directly to a file named "output.txt"
File.WriteAllText("output.txt", results.Text);
// You can add this line to confirm the file was saved:
Console.WriteLine("OCR results saved to output.txt");using IronOcr;
using System.IO;
IronTesseract ocr = new IronTesseract();
ocr.Configuration = new TesseractConfiguration
{
// Whitelist only Hiragana, Katakana, numbers, and common Japanese punctuation
WhiteListCharacters = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" +
"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン" +
"0123456789、。?!()¥ー",
// Blacklist common noise/symbols you want to ignore
BlackListCharacters = "★■§",
};
var ocrInput = new OcrInput();
// Load Japanese input image
ocrInput.LoadImage("jp.png");
// Perform OCR on the input image with ReadPhoto method
var results = ocr.ReadPhoto(ocrInput);
// Write the text result directly to a file named "output.txt"
File.WriteAllText("output.txt", results.Text);
// You can add this line to confirm the file was saved:
Console.WriteLine("OCR results saved to output.txt");Imports IronOcr
Imports System.IO
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.WhiteListCharacters = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" &
"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン" &
"0123456789、。?!()¥ー",
.BlackListCharacters = "★■§"
}
Dim ocrInput As New OcrInput()
' Load Japanese input image
ocrInput.LoadImage("jp.png")
' Perform OCR on the input image with ReadPhoto method
Dim results = ocr.ReadPhoto(ocrInput)
' Write the text result directly to a file named "output.txt"
File.WriteAllText("output.txt", results.Text)
' You can add this line to confirm the file was saved:
Console.WriteLine("OCR results saved to output.txt")Imports IronOcr
Imports System.IO
Dim ocr As New IronTesseract()
ocr.Configuration = New TesseractConfiguration With {
.WhiteListCharacters = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" &
"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン" &
"0123456789、。?!()¥ー",
.BlackListCharacters = "★■§"
}
Dim ocrInput As New OcrInput()
' Load Japanese input image
ocrInput.LoadImage("jp.png")
' Perform OCR on the input image with ReadPhoto method
Dim results = ocr.ReadPhoto(ocrInput)
' Write the text result directly to a file named "output.txt"
File.WriteAllText("output.txt", results.Text)
' You can add this line to confirm the file was saved:
Console.WriteLine("OCR results saved to output.txt")出力

完全なフィルターされた出力はテキストファイルとして利用できます:jp-output.txt。
ホワイトリストには基本的なひらがなとカタカナの文字のみが含まれているため、プ(pu)やデ(de)などの派生的な有声記号は除外されます。 価格(price)や購入(purchase)などの漢字も、ホワイトリストに登録された文字セットに含まれていないため除外されます。 ★、■、§のようなブラックリストに登録された記号は、ホワイトリストに関係なく積極的に削除されます。
次はどこへ行くべきでしょうか?
高度な読解シナリオ向けにIronOCRを設定する方法が理解できたので、以下を試してみてください。
- 特定の文書タイプを読み取る、たとえば パスポート や ナンバープレート
- 独立した OCR のユースケースとしてのバーコードおよび QR コードの読み取り
- 処理された結果からの hOCR および検索可能な PDF のエクスポート
本番使用時は、ウォーターマークを除去し、完全な機能にアクセスするためにライセンスを取得することを忘れないでください。
よくある質問
IronOCR を使用してOCR出力を特定の文字に制限するにはどうすればよいですか?
IronOCR では、TesseractConfiguration の WhiteListCharacters プロパティを使用して OCR 出力を特定の文字に制限できます。これにより、ホワイトリストにある文字のみを認識し、ノイズを減らし、精度を向上させることができます。
IronOCR の `BlackListCharacters` 機能の目的は何ですか?
IronOCR の BlackListCharacters プロパティは、OCR 出力から特定の文字を無視して削除できるようにします。これは、認識プロセスから既知のノイズ記号を除外するのに役立ちます。
IronOCR でバーコードとデータ テーブルの読み取りを有効にするにはどうすればよいですか?
IronOCR でバーコードとデータ テーブルの読み取りを有効にするには、TesseractConfiguration で ReadBarCodes および ReadDataTables プロパティを true に設定します。これにより、OCR エンジンがドキュメント内のバーコードとテーブル構造を検出できるようになります。
PageSegmentationMode とは何ですか、そして OCR 処理にどのように影響しますか?
IronOCR の PageSegmentationMode は、テキスト認識の前に Tesseract が入力画像をどのようにセグメント化するかを決定します。SingleLine や SparseText などの異なるモードは、単一行のラベルや不規則なテキスト配置の複雑なページなど、さまざまなレイアウトに対して OCR を最適化します。
IronOCR は検索可能な PDF を生成できますか?
はい、IronOCR は TesseractConfiguration において RenderSearchablePdf を true に設定することで、検索可能な PDF を生成できます。これにより、元の画像の上に不可視なテキスト層が作成され、テキストの検索およびコピー機能が有効になります。
IronOCR の hOCR 出力とは何ですか?
IronOCR の hOCR 出力は、各単語のバウンディングボックス座標と共にテキスト コンテンツをエンコードする HTML 形式です。これを有効にするには、RenderHocr を true に設定し、ダウンストリーム処理用に HTML 内で正確な単語位置を可能にします。
IronOCR を使用して国際ドキュメントの OCR を実行するにはどうすればよいですか?
IronOCR は、Unicode 文字フィルタリングを許可することにより国際ドキュメントを処理します。WhiteListCharacters および BlackListCharacters に Unicode 文字を設定することで、どのスクリプトと記号が認識されるかを制御し、中国語、日本語、韓国語などの言語を正確に処理します。
IronOCR で `TesseractConfiguration` を設定する利点は何ですか?
IronOCR で TesseractConfiguration を設定することにより、開発者は文字のホワイトリスト/ブラックリスト、バーコード検出、テーブル構造の読み取り、ページ分割モードなどのオプションを使用して OCR 処理を微調整し、さまざまなドキュメントタイプにわたって高度な読み取りシナリオを実現できます。
IronOCR は混合言語を含む画像内のテキストを認識できますか?
IronOCR は、WhiteListCharacters を設定して目的のスクリプトの文字を含めることにより、混合言語の画像内のテキストを認識できます。IronOcr.Languages.Japanese などの適切な言語パッケージをインストールすることで、最適な認識結果が確保されます。
IronOCR はホワイトリストに含まれていない文字をどのように処理しますか?
IronOCR では、WhiteListCharacters プロパティに含まれていない文字は、OCR 出力から静かに削除されます。この機能は、不要なノイズを排除し、関連する文字セットに認識を集中させるのに役立ちます。
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。