diff --git a/modules/calib3d/test/test_reproject_image_to_3d.cpp b/modules/calib3d/test/test_reproject_image_to_3d.cpp index 3e77a290ce..7364d3bf46 100644 --- a/modules/calib3d/test/test_reproject_image_to_3d.cpp +++ b/modules/calib3d/test/test_reproject_image_to_3d.cpp @@ -138,7 +138,12 @@ protected: { InT d = disp(y, x); - double from[4] = { x, y, d, 1 }; + double from[4] = { + static_cast(x), + static_cast(y), + static_cast(d), + 1.0, + }; Mat_ res = Q * Mat_(4, 1, from); res /= res(3, 0); diff --git a/modules/calib3d/test/test_undistort_badarg.cpp b/modules/calib3d/test/test_undistort_badarg.cpp index f3f762fa65..cfce8a49c6 100644 --- a/modules/calib3d/test/test_undistort_badarg.cpp +++ b/modules/calib3d/test/test_undistort_badarg.cpp @@ -104,7 +104,10 @@ void CV_UndistortPointsBadArgTest::run(int) img_size.height = 600; double cam[9] = {150.f, 0.f, img_size.width/2.f, 0, 300.f, img_size.height/2.f, 0.f, 0.f, 1.f}; double dist[4] = {0.01,0.02,0.001,0.0005}; - double s_points[N_POINTS2] = {img_size.width/4,img_size.height/4}; + double s_points[N_POINTS2] = { + static_cast(img_size.width) / 4.0, + static_cast(img_size.height) / 4.0, + }; double d_points[N_POINTS2]; double p[9] = {155.f, 0.f, img_size.width/2.f+img_size.width/50.f, 0, 310.f, img_size.height/2.f+img_size.height/50.f, 0.f, 0.f, 1.f}; double r[9] = {1,0,0,0,1,0,0,0,1}; diff --git a/modules/core/test/test_io.cpp b/modules/core/test/test_io.cpp index 37bff62151..0c401f8ebd 100644 --- a/modules/core/test/test_io.cpp +++ b/modules/core/test/test_io.cpp @@ -144,7 +144,11 @@ protected: depth = cvtest::randInt(rng) % (CV_64F+1); cn = cvtest::randInt(rng) % 4 + 1; - int sz[] = {cvtest::randInt(rng)%10+1, cvtest::randInt(rng)%10+1, cvtest::randInt(rng)%10+1}; + int sz[] = { + static_cast(cvtest::randInt(rng)%10+1), + static_cast(cvtest::randInt(rng)%10+1), + static_cast(cvtest::randInt(rng)%10+1), + }; MatND test_mat_nd(3, sz, CV_MAKETYPE(depth, cn)); rng0.fill(test_mat_nd, CV_RAND_UNI, Scalar::all(ranges[depth][0]), Scalar::all(ranges[depth][1])); @@ -156,8 +160,12 @@ protected: multiply(test_mat_nd, test_mat_scale, test_mat_nd); } - int ssz[] = {cvtest::randInt(rng)%10+1, cvtest::randInt(rng)%10+1, - cvtest::randInt(rng)%10+1,cvtest::randInt(rng)%10+1}; + int ssz[] = { + static_cast(cvtest::randInt(rng)%10+1), + static_cast(cvtest::randInt(rng)%10+1), + static_cast(cvtest::randInt(rng)%10+1), + static_cast(cvtest::randInt(rng)%10+1), + }; SparseMat test_sparse_mat = cvTsGetRandomSparseMat(4, ssz, cvtest::randInt(rng)%(CV_64F+1), cvtest::randInt(rng) % 10000, 0, 100, rng); diff --git a/modules/cudawarping/perf/perf_warping.cpp b/modules/cudawarping/perf/perf_warping.cpp index 36662418c3..6ce547e60e 100644 --- a/modules/cudawarping/perf/perf_warping.cpp +++ b/modules/cudawarping/perf/perf_warping.cpp @@ -253,7 +253,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpAffine, const double aplha = CV_PI / 4; const double mat[2 * 3] = { - std::cos(aplha), -std::sin(aplha), src.cols / 2, + std::cos(aplha), -std::sin(aplha), static_cast(src.cols) / 2.0, std::sin(aplha), std::cos(aplha), 0 }; const cv::Mat M(2, 3, CV_64F, (void*) mat); @@ -301,7 +301,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpPerspective, declare.in(src, WARMUP_RNG); const double aplha = CV_PI / 4; - double mat[3][3] = { {std::cos(aplha), -std::sin(aplha), src.cols / 2}, + double mat[3][3] = { {std::cos(aplha), -std::sin(aplha), static_cast(src.cols) / 2.0}, {std::sin(aplha), std::cos(aplha), 0}, {0.0, 0.0, 1.0}}; const cv::Mat M(3, 3, CV_64F, (void*) mat); diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index 90840cdaa5..dbe8a6315a 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -2770,7 +2770,7 @@ public: #if CV_SSE3 int CV_DECL_ALIGNED(16) buf[4]; float CV_DECL_ALIGNED(16) bufSum[4]; - static const int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; + static const unsigned int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; bool haveSSE3 = checkHardwareSupport(CV_CPU_SSE3); #endif @@ -3152,7 +3152,7 @@ public: #if CV_SSE3 int CV_DECL_ALIGNED(16) idxBuf[4]; float CV_DECL_ALIGNED(16) bufSum32[4]; - static const int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; + static const unsigned int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; bool haveSSE3 = checkHardwareSupport(CV_CPU_SSE3); #endif diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 3611253202..974545994b 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -226,7 +226,7 @@ static bool pyopencv_to(PyObject* o, Mat& m, const ArgInfo info) if( PyInt_Check(o) ) { - double v[] = {(double)PyInt_AsLong((PyObject*)o), 0., 0., 0.}; + double v[] = {static_cast(PyInt_AsLong((PyObject*)o)), 0., 0., 0.}; m = Mat(4, 1, CV_64F, v).clone(); return true; }