diff --git a/modules/core/test/test_operations.cpp b/modules/core/test/test_operations.cpp index 6b5f6e0cc1..29e22a6db6 100644 --- a/modules/core/test/test_operations.cpp +++ b/modules/core/test/test_operations.cpp @@ -774,7 +774,7 @@ bool CV_OperationsTest::TestTemplateMat() Mat m2 = Mat::zeros(10, 10, CV_8UC3); m1.copyTo(m2.row(1)); } - catch(const Exception& e) + catch(const Exception&) { badarg_catched = true; } diff --git a/modules/gpu/perf/perf_imgproc.cpp b/modules/gpu/perf/perf_imgproc.cpp index 4c1190a011..04f7730dc8 100644 --- a/modules/gpu/perf/perf_imgproc.cpp +++ b/modules/gpu/perf/perf_imgproc.cpp @@ -1739,7 +1739,7 @@ PERF_TEST_P(Method_Sz, ImgProc_GeneralizedHough, Combine( for (int i = 0; i < objCount; ++i) { double scale = rng.uniform(0.7, 1.3); - bool rotate = rng.uniform(0, 2); + bool rotate = 1 == rng.uniform(0, 2); cv::Mat obj; cv::resize(templ, obj, cv::Size(), scale, scale); diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp index a8142095b1..6a110fe1f8 100644 --- a/modules/imgproc/test/test_imgwarp_strict.cpp +++ b/modules/imgproc/test/test_imgwarp_strict.cpp @@ -433,7 +433,7 @@ void CV_Resize_Test::run_reference_func() double CV_Resize_Test::getWeight(double a, double b, int x) { - float w = std::min(static_cast(x + 1), b) - std::max(static_cast(x), a); + double w = std::min(static_cast(x + 1), b) - std::max(static_cast(x), a); CV_Assert(w >= 0); return w; } @@ -514,7 +514,7 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d else if (interpolation == INTER_LINEAR || interpolation == INTER_CUBIC || interpolation == INTER_LANCZOS4) { internal::interpolate_method inter_func = internal::inter_array[interpolation - (interpolation == INTER_LANCZOS4 ? 2 : 1)]; - int elemsize = _src.elemSize(); + size_t elemsize = _src.elemSize(); int ofs = 0, ksize = 2; if (interpolation == INTER_CUBIC) @@ -557,10 +557,10 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d void CV_Resize_Test::generate_buffer(double scale, dim& _dim) { - int length = _dim.size(); - for (int dx = 0; dx < length; ++dx) + size_t length = _dim.size(); + for (size_t dx = 0; dx < length; ++dx) { - double fsx = scale * (dx + 0.5f) - 0.5f; + double fsx = scale * (dx + 0.5) - 0.5; int isx = cvFloor(fsx); _dim[dx] = std::make_pair(isx, fsx - isx); } diff --git a/samples/cpp/pca.cpp b/samples/cpp/pca.cpp index 7ab86eaf04..eb891be589 100644 --- a/samples/cpp/pca.cpp +++ b/samples/cpp/pca.cpp @@ -176,7 +176,7 @@ int main(int argc, char** argv) // display until user presses q imshow(winName, reconstruction); - char key = 0; + int key = 0; while(key != 'q') key = waitKey(); diff --git a/samples/cpp/simpleflow_demo.cpp b/samples/cpp/simpleflow_demo.cpp index a864ebc22e..c9eaba8efe 100644 --- a/samples/cpp/simpleflow_demo.cpp +++ b/samples/cpp/simpleflow_demo.cpp @@ -86,7 +86,7 @@ static void run(int argc, char** argv) { Mat flow; - float start = getTickCount(); + float start = (float)getTickCount(); calcOpticalFlowSF(frame1, frame2, flow, 3, 2, 4, 4.1, 25.5, 18, 55.0, 25.5, 0.35, 18, 55.0, 25.5, 10); @@ -156,7 +156,7 @@ static float calc_rmse(Mat flow1, Mat flow2) { } } } - return sqrt(sum / (1e-9 + counter)); + return (float)sqrt(sum / (1e-9 + counter)); } static void eval(int argc, char** argv) {