From: marina.kolpakova Date: Mon, 15 Oct 2012 11:27:33 +0000 (+0400) Subject: fix rounding bug in Level creation X-Git-Tag: submit/tizen_ivi/20141117.190038~2^2~1214^2~59^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=022a8b9698c0c488c03fdfb83b47bf1675b6712a;p=profile%2Fivi%2Fopencv.git fix rounding bug in Level creation --- diff --git a/modules/gpu/src/icf.hpp b/modules/gpu/src/icf.hpp index 06c8114..d829012 100644 --- a/modules/gpu/src/icf.hpp +++ b/modules/gpu/src/icf.hpp @@ -81,16 +81,7 @@ struct __align__(8) Level //is actually 24 bytes uchar2 workRect; uchar2 objSize; - Level(int idx, const Octave& oct, const float scale, const int w, const int h) - : octave(idx), relScale(scale / oct.scale), shrScale (relScale / (float)oct.shrinkage) - { - workRect.x = round(w / (float)oct.shrinkage); - workRect.y = round(h / (float)oct.shrinkage); - - objSize.x = round(oct.size.x * relScale); - objSize.y = round(oct.size.y * relScale); - } - + Level(int idx, const Octave& oct, const float scale, const int w, const int h); __device Level(){} }; diff --git a/modules/gpu/src/imgproc.cpp b/modules/gpu/src/imgproc.cpp index 0bf9c81..df02213 100644 --- a/modules/gpu/src/imgproc.cpp +++ b/modules/gpu/src/imgproc.cpp @@ -553,7 +553,7 @@ void cv::gpu::integralBuffered(const GpuMat& src, GpuMat& sum, GpuMat& buffer, S src.locateROI(whole, offset); - if (info.supports(WARP_SHUFFLE_FUNCTIONS) && src.cols <= 2048) + if (false && info.supports(WARP_SHUFFLE_FUNCTIONS) && src.cols <= 2048) { GpuMat srcAlligned; diff --git a/modules/gpu/src/softcascade.cpp b/modules/gpu/src/softcascade.cpp index fc7114b..e5d8cb9 100644 --- a/modules/gpu/src/softcascade.cpp +++ b/modules/gpu/src/softcascade.cpp @@ -65,6 +65,16 @@ cv::Size cv::gpu::SoftCascade::getRoiSize() const { throw_nogpu(); return cv::Si #include +cv::gpu::device::icf::Level::Level(int idx, const Octave& oct, const float scale, const int w, const int h) +: octave(idx), relScale(scale / oct.scale), shrScale (relScale / (float)oct.shrinkage) +{ + workRect.x = round(w / (float)oct.shrinkage); + workRect.y = round(h / (float)oct.shrinkage); + + objSize.x = cv::saturate_cast(oct.size.x * relScale); + objSize.y = cv::saturate_cast(oct.size.y * relScale); +} + namespace cv { namespace gpu { namespace device { namespace icf { void fillBins(cv::gpu::PtrStepSzb hogluv, const cv::gpu::PtrStepSzf& nangle, @@ -72,7 +82,7 @@ namespace icf { } namespace imgproc { - void meanShiftFiltering_gpu(const PtrStepSzb& src, PtrStepSzb dst, int sp, int sr, int maxIter, float eps, cudaStream_t stream); + void shfl_integral_gpu(PtrStepSzb img, PtrStepSz integral, cudaStream_t stream); } }}}