From 238ea7f0f0ab920b4743c08d0b2b69875b71ddc7 Mon Sep 17 00:00:00 2001 From: "marina.kolpakova" Date: Tue, 19 Mar 2013 03:25:33 +0400 Subject: [PATCH] fix warnings under win. --- modules/softcascade/src/cuda_invoker.hpp | 8 ++++---- modules/softcascade/src/detector_cuda.cpp | 14 +++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/softcascade/src/cuda_invoker.hpp b/modules/softcascade/src/cuda_invoker.hpp index 9bdd45b..9589b6f 100644 --- a/modules/softcascade/src/cuda_invoker.hpp +++ b/modules/softcascade/src/cuda_invoker.hpp @@ -63,14 +63,14 @@ typedef unsigned short ushort; struct Octave { + float scale; + ushort2 size; ushort index; ushort stages; ushort shrinkage; - ushort2 size; - float scale; Octave(const ushort i, const ushort s, const ushort sh, const ushort2 sz, const float sc) - : index(i), stages(s), shrinkage(sh), size(sz), scale(sc) {} + : scale(sc), size(sz), index(i), stages(s), shrinkage(sh) {} }; struct Level @@ -111,7 +111,7 @@ struct Detection Detection(){} __device_inline__ Detection(int _x, int _y, uchar _w, uchar _h, float c) - : x(_x), y(_y), w(_w), h(_h), confidence(c), kind(0) {}; + : x(static_cast(_x)), y(static_cast(_y)), w(_w), h(_h), confidence(c), kind(0) {}; }; struct GK107PolicyX4 diff --git a/modules/softcascade/src/detector_cuda.cpp b/modules/softcascade/src/detector_cuda.cpp index bbadc9c..4d3db29 100644 --- a/modules/softcascade/src/detector_cuda.cpp +++ b/modules/softcascade/src/detector_cuda.cpp @@ -80,8 +80,8 @@ namespace cv::softcascade::device::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 = cvRound(w / (float)oct.shrinkage); - workRect.y = cvRound(h / (float)oct.shrinkage); + workRect.x = (unsigned char)cvRound(w / (float)oct.shrinkage); + workRect.y = (unsigned char)cvRound(h / (float)oct.shrinkage); objSize.x = cv::saturate_cast(oct.size.x * relScale); objSize.y = cv::saturate_cast(oct.size.y * relScale); @@ -168,8 +168,8 @@ struct cv::softcascade::SCascade::Fields ushort nweaks = saturate_cast((int)fns[SC_OCT_WEAKS]); ushort2 size; - size.x = cvRound(origWidth * scale); - size.y = cvRound(origHeight * scale); + size.x = (unsigned short)cvRound(origWidth * scale); + size.y = (unsigned short)cvRound(origHeight * scale); device::Octave octave(octIndex, nweaks, shrinkage, size, scale); CV_Assert(octave.stages > 0); @@ -274,7 +274,7 @@ struct cv::softcascade::SCascade::Fields bool check(float mins,float maxs, int scales) { - bool updated = (minScale == mins) || (maxScale == maxs) || (totals = scales); + bool updated = ((minScale == mins) || (maxScale == maxs) || (totals = scales)); minScale = mins; maxScale = maxScale; @@ -463,6 +463,9 @@ public: DEFAULT_FRAME_HEIGHT = 480, HOG_LUV_BINS = 10 }; + +private: + cv::softcascade::SCascade::Fields& operator=( const cv::softcascade::SCascade::Fields & ); }; cv::softcascade::SCascade::SCascade(const double mins, const double maxs, const int sc, const int fl) @@ -619,6 +622,7 @@ private: cv::gpu::GpuMat bgr; cv::gpu::GpuMat gray; cv::gpu::GpuMat channels; + SeparablePreprocessor& operator=( const SeparablePreprocessor& ); }; } -- 2.7.4