From c7b4a6d4be59eecca8a9ba8ef45d84431d6e049b Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sun, 11 Sep 2016 14:06:32 +0900 Subject: [PATCH] =?UTF-8?q?crop=5Fw=E3=81=A8crop=5Fh=E3=81=8C=E9=81=95?= =?UTF-8?q?=E3=81=86=E5=80=A4=E3=81=AE=E6=99=82=E3=81=ABTTA=E3=82=92?= =?UTF-8?q?=E3=82=84=E3=82=8B=E3=81=A8=E5=87=BA=E5=8A=9B=E3=81=8C=E3=81=8A?= =?UTF-8?q?=E3=81=8B=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20#43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 86c82c1..8c2ed1e 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -1050,7 +1050,10 @@ Waifu2x::eWaifu2xError Waifu2x::ReconstructByNet(std::shared_ptr net, cons if (i >= 4) cv::flip(in, in, 1); // ] - ret = ProcessNet(net, crop_w, crop_h, use_tta, batch_size, in); + const int cw = (rotateNum % 2 == 0) ? crop_w : crop_h; + const int ch = (rotateNum % 2 == 0) ? crop_h : crop_w; + + ret = ProcessNet(net, cw, ch, use_tta, batch_size, in); if (ret != Waifu2x::eWaifu2xError_OK) return ret;