mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
ノイズ除去でアルファチャンネルが消失するバグを修正 #8
This commit is contained in:
parent
7083f0f785
commit
a3ecc985a9
@ -1613,12 +1613,15 @@ Waifu2x::eWaifu2xError Waifu2x::AfterReconstructFloatMatProcess(const bool isRec
|
|||||||
const double shrinkRatio = scale_ratio / std::pow(2.0, (double)scale2);
|
const double shrinkRatio = scale_ratio / std::pow(2.0, (double)scale2);
|
||||||
|
|
||||||
cv::Mat alpha;
|
cv::Mat alpha;
|
||||||
if (floatim.channels() == 4 && isReconstructScale)
|
if (floatim.channels() == 4)
|
||||||
{
|
{
|
||||||
std::vector<cv::Mat> planes;
|
std::vector<cv::Mat> planes;
|
||||||
cv::split(floatim, planes);
|
cv::split(floatim, planes);
|
||||||
|
|
||||||
|
if (isReconstructScale)
|
||||||
Reconstruct(false, true, cancel_func, planes[3], alpha);
|
Reconstruct(false, true, cancel_func, planes[3], alpha);
|
||||||
|
else
|
||||||
|
alpha = planes[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
// アルファチャンネルがあったらアルファを付加する
|
// アルファチャンネルがあったらアルファを付加する
|
||||||
|
Loading…
x
Reference in New Issue
Block a user