diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index 4a9a0f158122488ef0272f86b87eec0696e174d8..5dc1c03ee9338a1aeb8c585140abc58b898024b5 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -199,11 +199,11 @@ CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback, #ifdef __GNUC__ #define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, __func__, __FILE__, __LINE__) ) #define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, __func__, __FILE__, __LINE__) ) -#define CV_Assert( expr ) do { if(!(expr)) cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) ); } while(0) +#define CV_Assert( expr ) if((expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) ) #else #define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, "", __FILE__, __LINE__) ) #define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, "", __FILE__, __LINE__) ) -#define CV_Assert( expr ) do { if(!(expr)) cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) ); } while(0) +#define CV_Assert( expr ) if((expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) ) #endif #ifdef _DEBUG diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index fe4028be93313ec8f12e4b6d7cb911a4a0c5c211..7de62d817574e9534bf51984e645172ddf790022 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -147,15 +147,16 @@ static void updateContinuityFlag(Mat& m) static void finalizeHdr(Mat& m) { updateContinuityFlag(m); - if( m.dims > 2 ) + int d = m.dims; + if( d > 2 ) m.rows = m.cols = -1; if( m.data ) { m.datalimit = m.datastart + m.size[0]*m.step[0]; if( m.size[0] > 0 ) { - m.dataend = m.data; - for( int i = 0; i < m.dims; i++ ) + m.dataend = m.data + m.size[d-1]*m.step[d-1]; + for( int i = 0; i < d-1; i++ ) m.dataend += (m.size[i] - 1)*m.step[i]; } else @@ -599,7 +600,7 @@ void Mat::push_back(const Mat& elems) Mat cvarrToMat(const CvArr* arr, bool copyData, - bool allowND, int coiMode) + bool /*allowND*/, int coiMode) { if( !arr ) return Mat(); diff --git a/modules/highgui/include/opencv2/highgui/highgui.hpp b/modules/highgui/include/opencv2/highgui/highgui.hpp index 4a0aa45dec639761331582a661b8b32252c9a55a..305610ac74d86b88c6f876b07d71fc68e036b42c 100644 --- a/modules/highgui/include/opencv2/highgui/highgui.hpp +++ b/modules/highgui/include/opencv2/highgui/highgui.hpp @@ -131,7 +131,7 @@ public: virtual bool grab(); virtual bool retrieve(CV_OUT Mat& image, int channel=0); - virtual CV_WRAP_AS(query) VideoCapture& operator >> (Mat& image); + virtual VideoCapture& operator >> (Mat& image); virtual bool set(int propId, double value); virtual double get(int propId); @@ -152,7 +152,7 @@ public: virtual bool open(const string& filename, int fourcc, double fps, Size frameSize, bool isColor=true); virtual bool isOpened() const; - virtual CV_WRAP_AS(write) VideoWriter& operator << (const Mat& image); + virtual VideoWriter& operator << (const Mat& image); protected: Ptr writer; diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index a622c4fb7aa286fe206bbfcf908751a5e5538879..e2ca7cc13aa833bf25df5d34671fb8a6c8151f84 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -939,7 +939,7 @@ struct HSV2RGB_b typedef uchar channel_type; HSV2RGB_b(int _dstcn, int _blueIdx, int _hrange) - : dstcn(_dstcn), cvt(3, _blueIdx, _hrange) + : dstcn(_dstcn), cvt(3, _blueIdx, (float)_hrange) {} void operator()(const uchar* src, uchar* dst, int n) const @@ -1139,7 +1139,7 @@ struct HLS2RGB_b typedef uchar channel_type; HLS2RGB_b(int _dstcn, int _blueIdx, int _hrange) - : dstcn(_dstcn), cvt(3, _blueIdx, _hrange) + : dstcn(_dstcn), cvt(3, _blueIdx, (float)_hrange) {} void operator()(const uchar* src, uchar* dst, int n) const @@ -1528,7 +1528,7 @@ struct RGB2Luv_f float d = (4*13) / std::max(X + 15 * Y + 3 * Z, FLT_EPSILON); float u = L*(X*d - _un); - float v = L*((9*0.25)*Y*d - _vn); + float v = L*((9*0.25f)*Y*d - _vn); dst[i] = L; dst[i+1] = u; dst[i+2] = v; } @@ -1589,7 +1589,7 @@ struct Luv2RGB_f v = v*d + _vn; float iv = 1.f/v; X = 2.25f * u * Y * iv ; - Z = (12 - 3 * u - 20 * v) * Y * 0.25 * iv; + Z = (12 - 3 * u - 20 * v) * Y * 0.25f * iv; float R = X*C0 + Y*C1 + Z*C2; float G = X*C3 + Y*C4 + Z*C5;