From 33bd1da5895babacf6b7bca401d071475396ba77 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Wed, 25 Aug 2010 14:39:34 +0000 Subject: [PATCH] compilation errors under win32 --- modules/gpu/src/beliefpropagation_gpu.cpp | 5 +++-- modules/gpu/src/constantspacebp_gpu.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/gpu/src/beliefpropagation_gpu.cpp b/modules/gpu/src/beliefpropagation_gpu.cpp index b28fb4fdf..9b2a97eab 100644 --- a/modules/gpu/src/beliefpropagation_gpu.cpp +++ b/modules/gpu/src/beliefpropagation_gpu.cpp @@ -81,12 +81,13 @@ namespace void cv::gpu::StereoBeliefPropagation::estimateRecopmmendedParams( int width, int height, int & ndisp, int & iters, int & levels) { ndisp = width / 4; - if (ndisp & 1 != 0) ndisp++; + if ((ndisp & 1) != 0) + ndisp++; int mm =::max(width, height); iters = mm / 100 + 2; - levels = (int)(log(mm) + 1) * 4 / 5; + levels = cvRound(log((double)mm) + 1) * 4 / 5; if (levels == 0) levels++; } diff --git a/modules/gpu/src/constantspacebp_gpu.cpp b/modules/gpu/src/constantspacebp_gpu.cpp index 31c3dae46..01313e34f 100644 --- a/modules/gpu/src/constantspacebp_gpu.cpp +++ b/modules/gpu/src/constantspacebp_gpu.cpp @@ -108,12 +108,13 @@ namespace void cv::gpu::StereoConstantSpaceBP::estimateRecopmmendedParams( int width, int height, int & ndisp, int & iters, int & levels, int &nr_plane) { ndisp = (int) ((float) width / 3.14f); - if (ndisp & 1 != 0) ndisp++; + if ((ndisp & 1) != 0) + ndisp++; int mm = ::max(width, height); iters = mm / 100 + ((mm > 1200)? - 4 : 4); - levels = (int)log(mm) * 2 / 3; + levels = cvRound(log((double)mm)) * 2 / 3; if (levels == 0) levels++; nr_plane = (int) ((float) ndisp / pow(2.0, levels + 1));