From cad223c7e501dd687c70febe9c612359a4cb1144 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sat, 1 Dec 2018 15:02:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=AE=E6=96=B9=E3=81=AEstImage::ShrinkImage()=E3=81=A7?= =?UTF-8?q?=E3=81=AFcv::INTER=5FAREA=E3=82=92=E5=85=A8=E3=81=8F=E4=BD=BF?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20=E3=81=A7=E3=82=82CUI=E3=81=A7?= =?UTF-8?q?=E3=82=82GUI=E3=81=A7=E3=82=82=E3=81=93=E3=81=AE=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=81=AF=E4=BD=BF=E3=81=A3=E3=81=A6=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=8B=E3=82=89=E5=BD=B1=E9=9F=BF=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/stImage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/stImage.cpp b/common/stImage.cpp index 4b16be7..bd83fd3 100644 --- a/common/stImage.cpp +++ b/common/stImage.cpp @@ -770,7 +770,12 @@ void stImage::ShrinkImage(const int width, const int height) const cv::Size_ ns(width, 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; + if (scale_width < 0.5 || scale_height < 0.5) + argo = cv::INTER_AREA; cv::resize(mEndImage, mEndImage, ns, 0.0, 0.0, argo); }