サイズ指定の方のstImage::ShrinkImage()ではcv::INTER_AREAを全く使ってなかったのを修正

でもCUIでもGUIでもこの関数は使ってなかったから影響はない
This commit is contained in:
lltcggie 2018-12-01 15:02:32 +09:00
parent 20ad7ebd0b
commit cad223c7e5

View File

@ -770,7 +770,12 @@ void stImage::ShrinkImage(const int width, const int height)
const cv::Size_<int> 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);
}