From 0ba9cc962ec17cdcaba69b81f6a61d4e0434b6b2 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Tue, 17 May 2016 00:30:15 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 8 ++++---- common/waifu2x.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 6260c99..2a71fbc 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -426,7 +426,7 @@ void Waifu2x::quit_liblary() cv::Mat Waifu2x::LoadMat(const boost::filesystem::path &path) { cv::Mat mat; - LoadMat(mat, path); + LoadMat(mat, path, 0); return mat; } @@ -486,7 +486,7 @@ Waifu2x::eWaifu2xError Waifu2x::AlphaMakeBorder(std::vector &planes, co } // 画像を読み込んで値を0.0f〜1.0fの範囲に変換 -Waifu2x::eWaifu2xError Waifu2x::LoadMat(cv::Mat &float_image, const boost::filesystem::path &input_file) +Waifu2x::eWaifu2xError Waifu2x::LoadMat(cv::Mat &float_image, const boost::filesystem::path &input_file, const int alpha_offset) { cv::Mat original_image; @@ -535,7 +535,7 @@ Waifu2x::eWaifu2xError Waifu2x::LoadMat(cv::Mat &float_image, const boost::files cv::Mat alpha = planes[3]; planes.resize(3); - AlphaMakeBorder(planes, alpha, net_offset); + AlphaMakeBorder(planes, alpha, alpha_offset); planes.push_back(alpha); cv::merge(planes, convert); @@ -2074,7 +2074,7 @@ Waifu2x::eWaifu2xError Waifu2x::waifu2x(const boost::filesystem::path &input_fil const bool isJpeg = boost::iequals(ipext.string(), ".jpg") || boost::iequals(ipext.string(), ".jpeg"); cv::Mat float_image; - ret = LoadMat(float_image, input_file); + ret = LoadMat(float_image, input_file, net_offset); if (ret != eWaifu2xError_OK) return ret; diff --git a/common/waifu2x.h b/common/waifu2x.h index 535c564..6ab2ece 100644 --- a/common/waifu2x.h +++ b/common/waifu2x.h @@ -123,7 +123,7 @@ private: int inner_scale; // ネットで拡大される倍率 private: - eWaifu2xError LoadMat(cv::Mat &float_image, const boost::filesystem::path &input_file); + static eWaifu2xError LoadMat(cv::Mat &float_image, const boost::filesystem::path &input_file, const int alpha_offset); static eWaifu2xError LoadMatBySTBI(cv::Mat &float_image, const std::vector &img_data); static eWaifu2xError AlphaMakeBorder(std::vector &planes, const cv::Mat &alpha, const int offset); eWaifu2xError CreateBrightnessImage(const cv::Mat &float_image, cv::Mat &im); @@ -184,5 +184,5 @@ public: const std::string& used_process() const; - cv::Mat LoadMat(const boost::filesystem::path &path); + static cv::Mat LoadMat(const boost::filesystem::path &path); };