Fix size_t to int conversion

pull/2673/head
Ievgen Khvedchenia 11 years ago
parent 0e3bbd7026
commit c68cbfced3
  1. 11
      modules/features2d/src/akaze/nldiffusion_functions.cpp
  2. 6
      modules/features2d/src/akaze/nldiffusion_functions.h
  3. 6
      modules/features2d/src/kaze/nldiffusion_functions.cpp

@ -69,8 +69,7 @@ void gaussian_2D_convolution(const cv::Mat& src, cv::Mat& dst, const size_t& ksi
* A Scheme for Coherence-Enhancing Diffusion Filtering with Optimized Rotation Invariance,
* Journal of Visual Communication and Image Representation 2002
*/
void image_derivatives_scharr(const cv::Mat& src, cv::Mat& dst,
const size_t& xorder, const size_t& yorder) {
void image_derivatives_scharr(const cv::Mat& src, cv::Mat& dst, int xorder, int yorder) {
Scharr(src, dst, CV_32F, xorder, yorder, 1.0, 0, BORDER_DEFAULT);
}
@ -233,8 +232,7 @@ float compute_k_percentile(const cv::Mat& img, float perc, float gscale,
* @param yorder Derivative order in Y-direction (vertical)
* @param scale Scale factor for the derivative size
*/
void compute_scharr_derivatives(const cv::Mat& src, cv::Mat& dst, const size_t& xorder,
const size_t& yorder, const size_t& scale) {
void compute_scharr_derivatives(const cv::Mat& src, cv::Mat& dst, int xorder, int yorder, int scale) {
Mat kx, ky;
compute_derivative_kernels(kx, ky, xorder, yorder, scale);
@ -344,10 +342,9 @@ void halfsample_image(const cv::Mat& src, cv::Mat& dst) {
* @param dy The derivative order in y-direction
* @param scale The kernel size
*/
void compute_derivative_kernels(cv::OutputArray kx_, cv::OutputArray ky_,
const size_t& dx, const size_t& dy, const size_t& scale) {
void compute_derivative_kernels(cv::OutputArray kx_, cv::OutputArray ky_, int dx, int dy, int scale) {
const int ksize = 3 + 2 * ( (int)scale - 1);
const int ksize = 3 + 2 * (scale - 1);
// The usual Scharr kernel
if (scale == 1) {

@ -23,12 +23,10 @@ void weickert_diffusivity(const cv::Mat& Lx, const cv::Mat& Ly, cv::Mat& dst, co
void charbonnier_diffusivity(const cv::Mat& Lx, const cv::Mat& Ly, cv::Mat& dst, const float& k);
float compute_k_percentile(const cv::Mat& img, float perc, float gscale,
size_t nbins, size_t ksize_x, size_t ksize_y);
void compute_scharr_derivatives(const cv::Mat& src, cv::Mat& dst, const size_t& xorder,
const size_t& yorder, const size_t& scale);
void compute_scharr_derivatives(const cv::Mat& src, cv::Mat& dst, int xorder, int, int scale);
void nld_step_scalar(cv::Mat& Ld, const cv::Mat& c, cv::Mat& Lstep, const float& stepsize);
void downsample_image(const cv::Mat& src, cv::Mat& dst);
void halfsample_image(const cv::Mat& src, cv::Mat& dst);
void compute_derivative_kernels(cv::OutputArray kx_, cv::OutputArray ky_,
const size_t& dx, const size_t& dy, const size_t& scale);
void compute_derivative_kernels(cv::OutputArray kx_, cv::OutputArray ky_, int dx, int dy, int scale);
bool check_maximum_neighbourhood(const cv::Mat& img, int dsize, float value,
int row, int col, bool same_img);

@ -43,11 +43,11 @@ using namespace cv;
void gaussian_2D_convolution(const cv::Mat& src, cv::Mat& dst,
int ksize_x, int ksize_y, float sigma) {
size_t ksize_x_ = 0, ksize_y_ = 0;
int ksize_x_ = 0, ksize_y_ = 0;
// Compute an appropriate kernel size according to the specified sigma
if (sigma > ksize_x || sigma > ksize_y || ksize_x == 0 || ksize_y == 0) {
ksize_x_ = (size_t)ceil(2.0f*(1.0f + (sigma-0.8f)/(0.3f)));
ksize_x_ = (int)ceil(2.0f*(1.0f + (sigma-0.8f)/(0.3f)));
ksize_y_ = ksize_x_;
}
@ -196,7 +196,7 @@ float compute_k_percentile(const cv::Mat& img, float perc, float gscale,
}
if (nelements < nthreshold) {
kperc = 0.03;
kperc = 0.03f;
}
else {
kperc = hmax*((float)(k)/(float)nbins);

Loading…
Cancel
Save