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
@ -380,6 +380,8 @@ Waifu2x::eWaifu2xError Waifu2x::LoadMatBySTBI(cv::Mat &float_image, const std::s
|
||||
|
||||
// 画像から輝度の画像を取り出す
|
||||
Waifu2x::eWaifu2xError Waifu2x::CreateBrightnessImage(const cv::Mat &float_image, cv::Mat &im)
|
||||
{
|
||||
if (float_image.channels() > 1)
|
||||
{
|
||||
cv::Mat converted_color;
|
||||
cv::cvtColor(float_image, converted_color, ConvertMode);
|
||||
@ -389,6 +391,9 @@ Waifu2x::eWaifu2xError Waifu2x::CreateBrightnessImage(const cv::Mat &float_image
|
||||
|
||||
im = planes[0];
|
||||
planes.clear();
|
||||
}
|
||||
else
|
||||
im = float_image;
|
||||
|
||||
return eWaifu2xError_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user