在IronOCR中使用不同的處理方式保存影像

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

如何儲存應用了不同影像處理/影像過濾器的圖片?

應用以下簡單的代碼示例:

OcrInput Input = new OcrInput(browsFile_txt.Text);
    // Image filter being tested
    Input.ToGrayScale();
    foreach (var p in Input.Pages)
    {
    p.SaveAsImage($"{outputPath}\\{DateTime.Now.ToString("yyyyMMddhhmmss")}.png");
    }
OcrInput Input = new OcrInput(browsFile_txt.Text);
    // Image filter being tested
    Input.ToGrayScale();
    foreach (var p in Input.Pages)
    {
    p.SaveAsImage($"{outputPath}\\{DateTime.Now.ToString("yyyyMMddhhmmss")}.png");
    }
Dim Input As New OcrInput(browsFile_txt.Text)
	' Image filter being tested
	Input.ToGrayScale()
	For Each p In Input.Pages
	p.SaveAsImage($"{outputPath}\{DateTime.Now.ToString("yyyyMMddhhmmss")}.png")
	Next p
VB   C#

若要查看 IronOCR 中可用的完整圖像優化過濾器列表,請參閱https://ironsoftware.com/csharp/ocr/examples/ocr-image-filters-for-net-tesseract/

MSDN風格類別文件 -https://ironsoftware.com/csharp/ocr/object-reference/api/IronOcr.OcrInput.html#methods