mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
Yモデルで致命的なエラーが発生するの修正
This commit is contained in:
parent
8c2b96df61
commit
6feda47e61
@ -381,14 +381,19 @@ Waifu2x::eWaifu2xError Waifu2x::LoadMatBySTBI(cv::Mat &float_image, const std::s
|
|||||||
// 画像から輝度の画像を取り出す
|
// 画像から輝度の画像を取り出す
|
||||||
Waifu2x::eWaifu2xError Waifu2x::CreateBrightnessImage(const cv::Mat &float_image, cv::Mat &im)
|
Waifu2x::eWaifu2xError Waifu2x::CreateBrightnessImage(const cv::Mat &float_image, cv::Mat &im)
|
||||||
{
|
{
|
||||||
cv::Mat converted_color;
|
if (float_image.channels() > 1)
|
||||||
cv::cvtColor(float_image, converted_color, ConvertMode);
|
{
|
||||||
|
cv::Mat converted_color;
|
||||||
|
cv::cvtColor(float_image, converted_color, ConvertMode);
|
||||||
|
|
||||||
std::vector<cv::Mat> planes;
|
std::vector<cv::Mat> planes;
|
||||||
cv::split(converted_color, planes);
|
cv::split(converted_color, planes);
|
||||||
|
|
||||||
im = planes[0];
|
im = planes[0];
|
||||||
planes.clear();
|
planes.clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
im = float_image;
|
||||||
|
|
||||||
return eWaifu2xError_OK;
|
return eWaifu2xError_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user