--- a/libraries/akaze/src/nldiffusion_functions.cpp +++ b/libraries/akaze/src/nldiffusion_functions.cpp @@ -222,8 +222,8 @@ void halfsample_image(const RowMatrixXf& src, RowMatrixXf& dst) { // Do the whole resampling in one pass by using neighboring values. First, we // compute the borders. - const double x_kernel_size = static_cast(src.cols()) / dst.cols(); - const double y_kernel_size = static_cast(src.rows()) / dst.rows(); + const int x_kernel_size = static_cast(src.cols()) / dst.cols(); + const int y_kernel_size = static_cast(src.rows()) / dst.rows(); // Do simple linear interpolation. if (x_kernel_size == 2 && y_kernel_size == 2) { @@ -237,8 +237,8 @@ void halfsample_image(const RowMatrixXf& src, RowMatrixXf& dst) { return; } - const double x_kernel_clamped_size = static_cast(ceil(x_kernel_size)); - const double y_kernel_clamped_size = static_cast(ceil(y_kernel_size)); + const int x_kernel_clamped_size = static_cast(ceil(static_cast(src.cols()) / dst.cols())); + const int y_kernel_clamped_size = static_cast(ceil(static_cast(src.rows()) / dst.rows())); // Set up precomputed factor matrices. Eigen::RowVectorXf x_kernel_mul(static_cast(x_kernel_clamped_size)),