mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 21:52:49 +00:00
定義変更
This commit is contained in:
parent
1e77442f42
commit
0ba9cc962e
@ -426,7 +426,7 @@ void Waifu2x::quit_liblary()
|
|||||||
cv::Mat Waifu2x::LoadMat(const boost::filesystem::path &path)
|
cv::Mat Waifu2x::LoadMat(const boost::filesystem::path &path)
|
||||||
{
|
{
|
||||||
cv::Mat mat;
|
cv::Mat mat;
|
||||||
LoadMat(mat, path);
|
LoadMat(mat, path, 0);
|
||||||
|
|
||||||
return mat;
|
return mat;
|
||||||
}
|
}
|
||||||
@ -486,7 +486,7 @@ Waifu2x::eWaifu2xError Waifu2x::AlphaMakeBorder(std::vector<cv::Mat> &planes, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 画像を読み込んで値を0.0f~1.0fの範囲に変換
|
// 画像を読み込んで値を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;
|
cv::Mat original_image;
|
||||||
|
|
||||||
@ -535,7 +535,7 @@ Waifu2x::eWaifu2xError Waifu2x::LoadMat(cv::Mat &float_image, const boost::files
|
|||||||
|
|
||||||
cv::Mat alpha = planes[3];
|
cv::Mat alpha = planes[3];
|
||||||
planes.resize(3);
|
planes.resize(3);
|
||||||
AlphaMakeBorder(planes, alpha, net_offset);
|
AlphaMakeBorder(planes, alpha, alpha_offset);
|
||||||
|
|
||||||
planes.push_back(alpha);
|
planes.push_back(alpha);
|
||||||
cv::merge(planes, convert);
|
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");
|
const bool isJpeg = boost::iequals(ipext.string(), ".jpg") || boost::iequals(ipext.string(), ".jpeg");
|
||||||
|
|
||||||
cv::Mat float_image;
|
cv::Mat float_image;
|
||||||
ret = LoadMat(float_image, input_file);
|
ret = LoadMat(float_image, input_file, net_offset);
|
||||||
if (ret != eWaifu2xError_OK)
|
if (ret != eWaifu2xError_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ private:
|
|||||||
int inner_scale; // ネットで拡大される倍率
|
int inner_scale; // ネットで拡大される倍率
|
||||||
|
|
||||||
private:
|
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 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);
|
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);
|
eWaifu2xError CreateBrightnessImage(const cv::Mat &float_image, cv::Mat &im);
|
||||||
@ -184,5 +184,5 @@ public:
|
|||||||
|
|
||||||
const std::string& used_process() const;
|
const std::string& used_process() const;
|
||||||
|
|
||||||
cv::Mat LoadMat(const boost::filesystem::path &path);
|
static cv::Mat LoadMat(const boost::filesystem::path &path);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user