From 673aa91bacdb5948cca6711dd3f30101cf5900d4 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 24 Oct 2012 20:27:20 +0400 Subject: [PATCH] Fix remaining windows build warnings --- modules/imgproc/perf/perf_warp.cpp | 2 +- modules/objdetect/src/haar.cpp | 10 ++++++++-- samples/cpp/pca.cpp | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/imgproc/perf/perf_warp.cpp b/modules/imgproc/perf/perf_warp.cpp index a79768e76..18e441f6d 100644 --- a/modules/imgproc/perf/perf_warp.cpp +++ b/modules/imgproc/perf/perf_warp.cpp @@ -119,7 +119,7 @@ PERF_TEST_P( TestWarpPerspectiveNear_t, WarpPerspectiveNear, resize(src, src, size); - int shift = src.cols*0.04; + int shift = static_cast(src.cols*0.04); Mat srcVertices = (Mat_(1, 4) << Vec2f(0, 0), Vec2f(static_cast(size.width-1), 0), Vec2f(static_cast(size.width-1), static_cast(size.height-1)), diff --git a/modules/objdetect/src/haar.cpp b/modules/objdetect/src/haar.cpp index 92da4ac25..96bc7603b 100644 --- a/modules/objdetect/src/haar.cpp +++ b/modules/objdetect/src/haar.cpp @@ -728,8 +728,14 @@ double icvEvalHidHaarClassifierAVX( CvHidHaarClassifier* classifier, sum = _mm256_add_ps(sum,_mm256_load_ps(tmp)); - __m256 left = _mm256_set_ps(nodes[7]->left, nodes[6]->left, nodes[5]->left, nodes[4]->left, nodes[3]->left, nodes[2]->left, nodes[1]->left, nodes[0]->left ); - __m256 right = _mm256_set_ps(nodes[7]->right,nodes[6]->right,nodes[5]->right,nodes[4]->right,nodes[3]->right,nodes[2]->right,nodes[1]->right,nodes[0]->right); + __m256 left = _mm256_set_ps(static_cast(nodes[7]->left), static_cast(nodes[6]->left), + static_cast(nodes[5]->left), static_cast(nodes[4]->left), + static_cast(nodes[3]->left), static_cast(nodes[2]->left), + static_cast(nodes[1]->left), static_cast(nodes[0]->left)); + __m256 right = _mm256_set_ps(static_cast(nodes[7]->right),static_cast(nodes[6]->right), + static_cast(nodes[5]->right),static_cast(nodes[4]->right), + static_cast(nodes[3]->right),static_cast(nodes[2]->right), + static_cast(nodes[1]->right),static_cast(nodes[0]->right)); _mm256_store_si256((__m256i*)idxV, _mm256_cvttps_epi32(_mm256_blendv_ps(right, left, _mm256_cmp_ps(sum, t, _CMP_LT_OQ)))); diff --git a/samples/cpp/pca.cpp b/samples/cpp/pca.cpp index eb891be58..ed23c7622 100644 --- a/samples/cpp/pca.cpp +++ b/samples/cpp/pca.cpp @@ -64,7 +64,7 @@ static void read_imgList(const string& filename, vector& images) { static Mat formatImagesForPCA(const vector &data) { - Mat dst(data.size(), data[0].rows*data[0].cols, CV_32F); + Mat dst(static_cast(data.size()), data[0].rows*data[0].cols, CV_32F); for(unsigned int i = 0; i < data.size(); i++) { Mat image_row = data[i].clone().reshape(1,1);