定義変更

This commit is contained in:
lltcggie 2016-05-17 00:30:15 +09:00
parent 1e77442f42
commit 0ba9cc962e
2 changed files with 6 additions and 6 deletions

View File

@ -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<cv::Mat> &planes, co
}
// 画像を読み込んで値を0.0f1.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;

View File

@ -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<char> &img_data);
static eWaifu2xError AlphaMakeBorder(std::vector<cv::Mat> &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);
};