From a3ecc985a9386ba97e61d9535b4884dcc35f26ed Mon Sep 17 00:00:00 2001 From: lltcggie Date: Thu, 31 Dec 2015 14:43:27 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8E=E3=82=A4=E3=82=BA=E9=99=A4=E5=8E=BB?= =?UTF-8?q?=E3=81=A7=E3=82=A2=E3=83=AB=E3=83=95=E3=82=A1=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=B3=E3=83=8D=E3=83=AB=E3=81=8C=E6=B6=88=E5=A4=B1=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=20#8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 32f42c2..14ba173 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -1613,12 +1613,15 @@ Waifu2x::eWaifu2xError Waifu2x::AfterReconstructFloatMatProcess(const bool isRec const double shrinkRatio = scale_ratio / std::pow(2.0, (double)scale2); cv::Mat alpha; - if (floatim.channels() == 4 && isReconstructScale) + if (floatim.channels() == 4) { std::vector planes; cv::split(floatim, planes); - Reconstruct(false, true, cancel_func, planes[3], alpha); + if (isReconstructScale) + Reconstruct(false, true, cancel_func, planes[3], alpha); + else + alpha = planes[3]; } // アルファチャンネルがあったらアルファを付加する