From 291e1e1d1e3e3398880f2a39437cf90d12065862 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sun, 20 Mar 2016 14:10:04 +0900 Subject: [PATCH] =?UTF-8?q?=E7=B8=AE=E5=B0=8F=E3=81=AE=E3=81=BF=E3=82=92?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AE=E7=B8=AE=E5=B0=8F?= =?UTF-8?q?=E3=82=A2=E3=83=AB=E3=82=B4=E3=83=AA=E3=82=BA=E3=83=A0=E3=82=92?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 7e3ff5e..9686721 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -1682,7 +1682,13 @@ Waifu2x::eWaifu2xError Waifu2x::AfterReconstructFloatMatProcess(const bool isRec { const cv::Size_ ns(image_size.width * shrinkRatio, image_size.height * shrinkRatio); if (image_size.width != ns.width || image_size.height != ns.height) - cv::resize(process_image, process_image, ns, 0.0, 0.0, cv::INTER_CUBIC); + { + int argo = cv::INTER_CUBIC; + if(ratio < 0.5) + argo = cv::INTER_AREA; + + cv::resize(process_image, process_image, ns, 0.0, 0.0, argo); + } } // 値を0〜1にクリッピング