mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
縮小のみをする場合の縮小アルゴリズムを調整
This commit is contained in:
parent
c936814264
commit
291e1e1d1e
@ -1682,7 +1682,13 @@ Waifu2x::eWaifu2xError Waifu2x::AfterReconstructFloatMatProcess(const bool isRec
|
|||||||
{
|
{
|
||||||
const cv::Size_<int> ns(image_size.width * shrinkRatio, image_size.height * shrinkRatio);
|
const cv::Size_<int> ns(image_size.width * shrinkRatio, image_size.height * shrinkRatio);
|
||||||
if (image_size.width != ns.width || image_size.height != ns.height)
|
if (image_size.width != ns.width || image_size.height != ns.height)
|
||||||
cv::resize(process_image, process_image, ns, 0.0, 0.0, cv::INTER_CUBIC);
|
{
|
||||||
|
int argo = cv::INTER_CUBIC;
|
||||||
|
if(ratio < 0.5)
|
||||||
|
argo = cv::INTER_AREA;
|
||||||
|
|
||||||
|
cv::resize(process_image, process_image, ns, 0.0, 0.0, argo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 値を0~1にクリッピング
|
// 値を0~1にクリッピング
|
||||||
|
Loading…
x
Reference in New Issue
Block a user