diff --git a/modules/gpu/src/icf.hpp b/modules/gpu/src/icf.hpp index 295255f578..3f3449bad5 100644 --- a/modules/gpu/src/icf.hpp +++ b/modules/gpu/src/icf.hpp @@ -88,11 +88,11 @@ struct __align__(8) Node { uchar4 rect; // ushort channel; - uint threshold; + unsigned int threshold; enum { THRESHOLD_MASK = 0x0FFFFFFF }; - Node(const uchar4 r, const uint ch, const uint t) : rect(r), threshold(t + (ch << 28)) {} + Node(const uchar4 r, const unsigned int ch, const unsigned int t) : rect(r), threshold(t + (ch << 28)) {} }; struct __align__(16) Detection @@ -144,7 +144,7 @@ struct CascadeInvoker const int downscales, const cudaStream_t& stream = 0) const; template - __device void detect(Detection* objects, const uint ndetections, uint* ctr, const int downscales) const; + __device void detect(Detection* objects, const unsigned int ndetections, unsigned int* ctr, const int downscales) const; }; } diff --git a/modules/gpu/src/softcascade.cpp b/modules/gpu/src/softcascade.cpp index 1ccfa3a9db..431eeba0ef 100644 --- a/modules/gpu/src/softcascade.cpp +++ b/modules/gpu/src/softcascade.cpp @@ -64,8 +64,8 @@ void cv::gpu::SCascade::read(const FileNode& fn) { Algorithm::read(fn); } cv::gpu::device::icf::Level::Level(int idx, const Octave& oct, const float scale, const int w, const int h) : octave(idx), step(oct.stages), relScale(scale / oct.scale) { - workRect.x = round(w / (float)oct.shrinkage); - workRect.y = round(h / (float)oct.shrinkage); + workRect.x = cvRound(w / (float)oct.shrinkage); + workRect.y = cvRound(h / (float)oct.shrinkage); objSize.x = cv::saturate_cast(oct.size.x * relScale); objSize.y = cv::saturate_cast(oct.size.y * relScale); @@ -75,7 +75,7 @@ cv::gpu::device::icf::Level::Level(int idx, const Octave& oct, const float scale scaling[0] = scaling[1] = 1.f; else { - scaling[0] = (relScale < 1.f) ? 0.89f * ::pow(relScale, 1.099f / ::log(2)) : 1.f; + scaling[0] = (relScale < 1.f) ? 0.89f * ::pow(relScale, 1.099f / ::log(2.0f)) : 1.f; scaling[1] = relScale * relScale; } } @@ -199,7 +199,7 @@ struct cv::gpu::SCascade::Fields // int feature = (int)(*(inIt +=2)) + feature_offset; inIt +=3; // extract feature, Todo:check it - uint th = saturate_cast((float)(*(inIt++))); + unsigned int th = saturate_cast((float)(*(inIt++))); cv::FileNode ftn = (*ftrs)[SC_F_RECT]; cv::FileNodeIterator r_it = ftn.begin(); uchar4 rect; @@ -214,7 +214,7 @@ struct cv::gpu::SCascade::Fields rect.w -= rect.y; } - uint channel = saturate_cast((int)(*ftrs)[SC_F_CHANNEL]); + unsigned int channel = saturate_cast((int)(*ftrs)[SC_F_CHANNEL]); vnodes.push_back(Node(rect, channel, th)); ++ftrs; } @@ -426,7 +426,7 @@ private: GpuMat nmag(fplane, cv::Rect(0, 4 * fh, fw, fh)); GpuMat nang(fplane, cv::Rect(0, 5 * fh, fw, fh)); - cv::gpu::multiply(mag, cv::Scalar::all(1.f / (8 *::log(2))), nmag, 1, -1, s); + cv::gpu::multiply(mag, cv::Scalar::all(1.f / (8 *::log(2.0f))), nmag, 1, -1, s); cv::gpu::multiply(ang, cv::Scalar::all(1.f / 60.f), nang, 1, -1, s); //create uchar magnitude