IronOCRの文字認識・テキスト抽出で異なる処理を施した画像を保存する方法
This article was translated from English: Does it need improvement?
Translated
View the article in English
異なる画像処理/画像フィルターを適用した画像文字認識の前後に画像を保存するにはどうすればよいですか?
次の簡単なコード例を適用します。
// Create a new instance of OcrInput from a text box input for file path.
OcrInput input = new OcrInput(browsFile_txt.Text);
// Apply a grayscale filter to the image.
input.ToGrayScale();
// Iterate through each page in the OcrInput object.
foreach (var p in input.Pages)
{
// Save each processed page as an image with a unique timestamped filename.
p.SaveAsImage($"{outputPath}\\{DateTime.Now.ToString("yyyyMMddHHmmss")}.png");
}
// Create a new instance of OcrInput from a text box input for file path.
OcrInput input = new OcrInput(browsFile_txt.Text);
// Apply a grayscale filter to the image.
input.ToGrayScale();
// Iterate through each page in the OcrInput object.
foreach (var p in input.Pages)
{
// Save each processed page as an image with a unique timestamped filename.
p.SaveAsImage($"{outputPath}\\{DateTime.Now.ToString("yyyyMMddHHmmss")}.png");
}
' Create a new instance of OcrInput from a text box input for file path.
Dim input As New OcrInput(browsFile_txt.Text)
' Apply a grayscale filter to the image.
input.ToGrayScale()
' Iterate through each page in the OcrInput object.
For Each p In input.Pages
' Save each processed page as an image with a unique timestamped filename.
p.SaveAsImage($"{outputPath}\{DateTime.Now.ToString("yyyyMMddHHmmss")}.png")
Next p
$vbLabelText
$csharpLabel
IronOCR で使用できる画像最適化フィルターの完全なリストについては、 "IronOCR 画像フィルター"を参照してください。
MSDN スタイルのクラスドキュメント - OcrInput メソッド
準備はできましたか?
Nuget ダウンロード 5,585,834 | バージョン: 2026.4 リリース

