mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-25 21:22:47 +00:00
サイズ指定の方のstImage::ShrinkImage()ではcv::INTER_AREAを全く使ってなかったのを修正
でもCUIでもGUIでもこの関数は使ってなかったから影響はない
This commit is contained in:
parent
20ad7ebd0b
commit
cad223c7e5
@ -770,7 +770,12 @@ void stImage::ShrinkImage(const int width, const int height)
|
|||||||
const cv::Size_<int> ns(width, height);
|
const cv::Size_<int> ns(width, height);
|
||||||
if (mEndImage.size().width != ns.width || mEndImage.size().height != ns.height)
|
if (mEndImage.size().width != ns.width || mEndImage.size().height != ns.height)
|
||||||
{
|
{
|
||||||
|
const auto scale_width = (float)mEndImage.size().width / (float)ns.width;
|
||||||
|
const auto scale_height = (float)mEndImage.size().height / (float)ns.height;
|
||||||
|
|
||||||
int argo = cv::INTER_CUBIC;
|
int argo = cv::INTER_CUBIC;
|
||||||
|
if (scale_width < 0.5 || scale_height < 0.5)
|
||||||
|
argo = cv::INTER_AREA;
|
||||||
|
|
||||||
cv::resize(mEndImage, mEndImage, ns, 0.0, 0.0, argo);
|
cv::resize(mEndImage, mEndImage, ns, 0.0, 0.0, argo);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user