From c9368142646b409ab681238e226731fad5bfd90c Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sun, 20 Mar 2016 14:00:35 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=83=E3=81=AE=E7=94=BB=E5=83=8F=E3=82=B5?= =?UTF-8?q?=E3=82=A4=E3=82=BA=E3=82=88=E3=82=8A=E5=B0=8F=E3=81=95=E3=81=84?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=AB=E5=A4=89=E6=8F=9B=EF=BC=88?= =?UTF-8?q?=E3=81=9F=E3=81=A0=E3=81=AE=E7=B8=AE=E5=B0=8F=EF=BC=89=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E5=A4=89=E6=8F=9B=E5=BE=8C=E3=81=AE=E3=82=B5?= =?UTF-8?q?=E3=82=A4=E3=82=BA=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index e57f047..7e3ff5e 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -1652,7 +1652,7 @@ Waifu2x::eWaifu2xError Waifu2x::AfterReconstructFloatMatProcess(const bool isRec const double ratio = CalcScaleRatio(image_size); const int scale2 = ceil(log2(ratio)); - const double shrinkRatio = ratio / std::pow(2.0, (double)scale2); + const double shrinkRatio = ratio >= 1.0 ? ratio / std::pow(2.0, (double)scale2) : ratio; cv::Mat alpha; if (floatim.channels() == 4)