From 6bea9f5ec488aba5584c954d67b104c3e96b65b7 Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Wed, 25 Aug 2010 15:00:17 +0000 Subject: [PATCH] minor fix for windows --- modules/gpu/src/beliefpropagation_gpu.cpp | 2 +- modules/gpu/src/constantspacebp_gpu.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/gpu/src/beliefpropagation_gpu.cpp b/modules/gpu/src/beliefpropagation_gpu.cpp index 9b2a97eab7..d5e3fab65a 100644 --- a/modules/gpu/src/beliefpropagation_gpu.cpp +++ b/modules/gpu/src/beliefpropagation_gpu.cpp @@ -87,7 +87,7 @@ void cv::gpu::StereoBeliefPropagation::estimateRecopmmendedParams( int width, in int mm =::max(width, height); iters = mm / 100 + 2; - levels = cvRound(log((double)mm) + 1) * 4 / 5; + levels = (int)(log(static_cast(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 01313e34f9..d14f7aea7a 100644 --- a/modules/gpu/src/constantspacebp_gpu.cpp +++ b/modules/gpu/src/constantspacebp_gpu.cpp @@ -108,13 +108,14 @@ 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 = cvRound(log((double)mm)) * 2 / 3; + levels = (int)log(static_cast(mm)) * 2 / 3; if (levels == 0) levels++; nr_plane = (int) ((float) ndisp / pow(2.0, levels + 1));