Skip to content

Commit

Permalink
ceil for image size
Browse files Browse the repository at this point in the history
  • Loading branch information
scheckmedia committed Jun 4, 2020
1 parent 6e09695 commit b058744
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/inference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ int Inference::prepare_image(std::string &filepath, cv::Mat &dest) {

float scale =
static_cast<float>(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;
Expand Down

0 comments on commit b058744

Please sign in to comment.