From b0587440df17cafa12699d24814f477ccfd89163 Mon Sep 17 00:00:00 2001 From: Tobias Scheck Date: Thu, 4 Jun 2020 17:59:35 +0200 Subject: [PATCH] ceil for image size --- src/inference.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inference.cpp b/src/inference.cpp index 12b4592..06b2c15 100644 --- a/src/inference.cpp +++ b/src/inference.cpp @@ -75,8 +75,8 @@ int Inference::prepare_image(std::string &filepath, cv::Mat &dest) { float scale = static_cast(CNN_INPUT_SIZE) / std::min(image.rows, image.cols); - float nw = round(image.cols * scale); - float nh = round(image.rows * scale); + float nw = ceil(image.cols * scale); + float nh = ceil(image.rows * scale); float half = CNN_INPUT_SIZE / 2.0; float cx = nw / 2.0; float cy = nh / 2.0;