From 84db4eb6fa71146a5beb478fb272dd4b2d7a85d6 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Tue, 14 Feb 2012 10:22:34 +0000 Subject: [PATCH] fixed ~200 warnings for windows minor build system changes (now cuda code in opencv_core is compiled using CUDA_ARCH* cmake variables) --- cmake/OpenCVFindOpenNI.cmake | 8 +++- modules/calib3d/test/test_homography.cpp | 4 +- modules/contrib/src/gencolors.cpp | 2 +- modules/contrib/src/imagelogpolprojection.hpp | 3 ++ modules/contrib/src/templatebuffer.hpp | 2 +- modules/core/CMakeLists.txt | 14 +------ modules/core/src/cmdparser.cpp | 4 +- modules/core/src/opengl_interop.cpp | 48 ++++++++++++++++++++++ modules/core/test/test_countnonzero.cpp | 2 +- modules/core/test/test_eigen.cpp | 4 +- modules/features2d/src/fast.cpp | 6 +-- modules/features2d/src/orb.cpp | 4 +- modules/flann/include/opencv2/flann/nn_index.h | 2 +- modules/gpu/include/opencv2/gpu/gpu.hpp | 2 +- modules/gpu/src/gftt.cpp | 2 +- modules/gpu/src/orb.cpp | 14 +++---- modules/gpu/test/test_features2d.cpp | 8 ++-- modules/highgui/src/cap_openni.cpp | 10 ++--- modules/highgui/src/window.cpp | 7 ++++ modules/highgui/src/window_w32.cpp | 1 + modules/imgproc/perf/perf_filter2d.cpp | 2 +- modules/imgproc/src/gabor.cpp | 4 +- modules/imgproc/src/geometry.cpp | 6 +-- modules/imgproc/src/morph.cpp | 9 ++-- modules/imgproc/src/thresh.cpp | 6 +-- .../include/opencv2/stitching/detail/util.hpp | 11 +++-- modules/stitching/perf/perf_stich.cpp | 4 +- modules/stitching/src/seam_finders.cpp | 2 + modules/ts/src/ts_perf.cpp | 1 + 29 files changed, 126 insertions(+), 66 deletions(-) diff --git a/cmake/OpenCVFindOpenNI.cmake b/cmake/OpenCVFindOpenNI.cmake index 2fbd698..1e892cf 100644 --- a/cmake/OpenCVFindOpenNI.cmake +++ b/cmake/OpenCVFindOpenNI.cmake @@ -24,7 +24,13 @@ if(OPENNI_LIBRARY AND OPENNI_INCLUDES) set(HAVE_OPENNI TRUE) # the check: are PrimeSensor Modules for OpenNI installed if(WIN32) - find_file(OPENNI_PRIME_SENSOR_MODULE "XnCore.dll" PATHS "c:/Program Files/Prime Sense/Sensor/Bin" DOC "Core library of PrimeSensor Modules for OpenNI") + find_file(OPENNI_PRIME_SENSOR_MODULE "XnCore.dll" + PATHS + "c:/Program Files/Prime Sense/Sensor/Bin" + "c:/Program Files (x86)/Prime Sense/Sensor/Bin" + "c:/Program Files/PrimeSense/SensorKinect/Bin" + "c:/Program Files (x86)/PrimeSense/SensorKinect/Bin" + DOC "Core library of PrimeSensor Modules for OpenNI") elseif(UNIX OR APPLE) find_library(OPENNI_PRIME_SENSOR_MODULE "XnCore" PATHS "/usr/lib" DOC "Core library of PrimeSensor Modules for OpenNI") endif() diff --git a/modules/calib3d/test/test_homography.cpp b/modules/calib3d/test/test_homography.cpp index 428dc0c..0c4a4e1 100644 --- a/modules/calib3d/test/test_homography.cpp +++ b/modules/calib3d/test/test_homography.cpp @@ -102,10 +102,10 @@ private: void print_information_8(int j, int N, int k, int l, double diff); }; -CV_HomographyTest::CV_HomographyTest() : max_diff(1e-2), max_2diff(2e-2) +CV_HomographyTest::CV_HomographyTest() : max_diff(1e-2f), max_2diff(2e-2f) { method = 0; - image_size = 1e+2; + image_size = 100; reproj_threshold = 3.0; sigma = 0.01; } diff --git a/modules/contrib/src/gencolors.cpp b/modules/contrib/src/gencolors.cpp index 0ecbdb2..1774631 100644 --- a/modules/contrib/src/gencolors.cpp +++ b/modules/contrib/src/gencolors.cpp @@ -63,7 +63,7 @@ void downsamplePoints( const Mat& src, Mat& dst, size_t count ) { for( int j = i; j < dists.cols; j++ ) { - float dist = norm(src.at >(i) - src.at >(j)); + float dist = (float)norm(src.at >(i) - src.at >(j)); dists.at(j, i) = dists.at(i, j) = dist; } } diff --git a/modules/contrib/src/imagelogpolprojection.hpp b/modules/contrib/src/imagelogpolprojection.hpp index cde6a3a..e7350e0 100644 --- a/modules/contrib/src/imagelogpolprojection.hpp +++ b/modules/contrib/src/imagelogpolprojection.hpp @@ -231,6 +231,9 @@ private: bool _initLogRetinaSampling(const double reductionFactor, const double samplingStrenght); bool _initLogPolarCortexSampling(const double reductionFactor, const double samplingStrenght); + ImageLogPolProjection(const ImageLogPolProjection&); + ImageLogPolProjection& operator=(const ImageLogPolProjection&); + }; } diff --git a/modules/contrib/src/templatebuffer.hpp b/modules/contrib/src/templatebuffer.hpp index 37e18bf..69d2699 100644 --- a/modules/contrib/src/templatebuffer.hpp +++ b/modules/contrib/src/templatebuffer.hpp @@ -260,7 +260,7 @@ public: * @param sensitivity: strenght of the sigmoide * @param maxOutputValue: the maximum output value */ - inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0, const type maxOutputValue=(type)255.0){normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels());}; + inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0, const type maxOutputValue=(type)255.0){ (void)maxOutputValue; normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels());}; /** * sigmoide image normalization function (saturates min and max values), in this function, the sigmoide is centered on low values (high saturation of the medium and high values diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 4f831f7..baf0fa1 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -10,19 +10,9 @@ if(HAVE_CUDA) file(GLOB lib_cuda "src/cuda/*.cu") source_group("Cuda" FILES "${lib_cuda}") - include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda") - - set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -gencode arch=compute_10,code=sm_10 - -gencode arch=compute_11,code=sm_11 - -gencode arch=compute_12,code=sm_12 - -gencode arch=compute_13,code=sm_13 - -gencode arch=compute_20,code=sm_20 - -gencode arch=compute_20,code=sm_21) - + include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda") OCV_CUDA_COMPILE(cuda_objs ${lib_cuda}) - - unset(CUDA_npp_LIBRARY CACHE) - find_cuda_helper_libs(npp) + set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) else() set(lib_cuda "") diff --git a/modules/core/src/cmdparser.cpp b/modules/core/src/cmdparser.cpp index 1d29b39..c76cf4e 100644 --- a/modules/core/src/cmdparser.cpp +++ b/modules/core/src/cmdparser.cpp @@ -291,7 +291,7 @@ template buf = ""; if (del_space(it->second[1]) != "") buf += del_space(it->second[1]); - while (true) + for(;;) { bool tr = ((int)buf.length() > col_d-2) ? true: false; int pos; @@ -299,7 +299,7 @@ template if (tr) { pos = buf.find_first_of(' '); - while (true) + for(;;) { if ((int)buf.find_first_of(' ', pos + 1 ) < col_d-2 && (int)buf.find_first_of(' ', pos + 1 ) != (int)std::string::npos) diff --git a/modules/core/src/opengl_interop.cpp b/modules/core/src/opengl_interop.cpp index d0b2385..e478c69 100644 --- a/modules/core/src/opengl_interop.cpp +++ b/modules/core/src/opengl_interop.cpp @@ -161,9 +161,11 @@ void icvSetOpenGlFuncTab(const CvOpenGlFuncTab* tab) void cv::gpu::setGlDevice(int device) { #ifndef HAVE_CUDA + (void)device; throw_nocuda; #else #ifndef HAVE_OPENGL + (void)device; throw_nogl; #else if (!glFuncTab()->isGlContextInitialized()) @@ -483,6 +485,7 @@ inline void cv::GlBuffer::Impl::unmapDevice(cudaStream_t stream) cv::GlBuffer::GlBuffer(Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage) { #ifndef HAVE_OPENGL + (void)usage; throw_nogl; #else impl_ = Impl::empty(); @@ -492,6 +495,10 @@ cv::GlBuffer::GlBuffer(Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage cv::GlBuffer::GlBuffer(int rows, int cols, int type, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage) { #ifndef HAVE_OPENGL + (void)rows; + (void)cols; + (void)type; + (void)usage; throw_nogl; #else impl_ = new Impl(rows, cols, type, usage); @@ -504,6 +511,9 @@ cv::GlBuffer::GlBuffer(int rows, int cols, int type, Usage usage) : rows_(0), co cv::GlBuffer::GlBuffer(Size size, int type, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage) { #ifndef HAVE_OPENGL + (void)size; + (void)type; + (void)usage; throw_nogl; #else impl_ = new Impl(size.height, size.width, type, usage); @@ -516,6 +526,8 @@ cv::GlBuffer::GlBuffer(Size size, int type, Usage usage) : rows_(0), cols_(0), t cv::GlBuffer::GlBuffer(InputArray mat_, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage) { #ifndef HAVE_OPENGL + (void)mat_; + (void)usage; throw_nogl; #else int kind = mat_.kind(); @@ -547,6 +559,10 @@ cv::GlBuffer::GlBuffer(InputArray mat_, Usage usage) : rows_(0), cols_(0), type_ void cv::GlBuffer::create(int rows, int cols, int type, Usage usage) { #ifndef HAVE_OPENGL + (void)rows; + (void)cols; + (void)type; + (void)usage; throw_nogl; #else if (rows_ != rows || cols_ != cols || type_ != type || usage_ != usage) @@ -572,6 +588,7 @@ void cv::GlBuffer::release() void cv::GlBuffer::copyFrom(InputArray mat_) { #ifndef HAVE_OPENGL + (void)mat_; throw_nogl; #else int kind = mat_.kind(); @@ -910,6 +927,9 @@ cv::GlTexture::GlTexture() : rows_(0), cols_(0), type_(0) cv::GlTexture::GlTexture(int rows, int cols, int type) : rows_(0), cols_(0), type_(0) { #ifndef HAVE_OPENGL + (void)rows; + (void)cols; + (void)type; throw_nogl; #else impl_ = new Impl(rows, cols, type); @@ -922,6 +942,8 @@ cv::GlTexture::GlTexture(int rows, int cols, int type) : rows_(0), cols_(0), typ cv::GlTexture::GlTexture(Size size, int type) : rows_(0), cols_(0), type_(0) { #ifndef HAVE_OPENGL + (void)size; + (void)type; throw_nogl; #else impl_ = new Impl(size.height, size.width, type); @@ -934,6 +956,8 @@ cv::GlTexture::GlTexture(Size size, int type) : rows_(0), cols_(0), type_(0) cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_(0) { #ifndef HAVE_OPENGL + (void)mat_; + (void)bgra; throw_nogl; #else int kind = mat_.kind(); @@ -977,6 +1001,9 @@ cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_ void cv::GlTexture::create(int rows, int cols, int type) { #ifndef HAVE_OPENGL + (void)rows; + (void)cols; + (void)type; throw_nogl; #else if (rows_ != rows || cols_ != cols || type_ != type) @@ -1001,6 +1028,8 @@ void cv::GlTexture::release() void cv::GlTexture::copyFrom(InputArray mat_, bool bgra) { #ifndef HAVE_OPENGL + (void)mat_; + (void)bgra; throw_nogl; #else int kind = mat_.kind(); @@ -1229,6 +1258,8 @@ cv::GlFont::GlFont(const string& family, int height, Weight weight, Style style) void cv::GlFont::draw(const char* str, int len) const { #ifndef HAVE_OPENGL + (void)str; + (void)len; throw_nogl; #else if (base_ && len > 0) @@ -1271,6 +1302,10 @@ namespace Ptr cv::GlFont::get(const std::string& family, int height, Weight weight, Style style) { #ifndef HAVE_OPENGL + (void)family; + (void)height; + (void)weight; + (void)style; throw_nogl; return Ptr(); #else @@ -1296,6 +1331,9 @@ Ptr cv::GlFont::get(const std::string& family, int height, Weight weight void cv::render(const GlTexture& tex, Rect_ wndRect, Rect_ texRect) { #ifndef HAVE_OPENGL + (void)tex; + (void)wndRect; + (void)texRect; throw_nogl; #else if (!tex.empty()) @@ -1328,6 +1366,9 @@ void cv::render(const GlTexture& tex, Rect_ wndRect, Rect_ texRe void cv::render(const GlArrays& arr, int mode, Scalar color) { #ifndef HAVE_OPENGL + (void)arr; + (void)mode; + (void)color; throw_nogl; #else glColor3d(color[0] / 255.0, color[1] / 255.0, color[2] / 255.0); @@ -1343,6 +1384,10 @@ void cv::render(const GlArrays& arr, int mode, Scalar color) void cv::render(const string& str, const Ptr& font, Scalar color, Point2d pos) { #ifndef HAVE_OPENGL + (void)str; + (void)font; + (void)color; + (void)pos; throw_nogl; #else glPushAttrib(GL_DEPTH_BUFFER_BIT); @@ -1497,6 +1542,9 @@ void cv::GlCamera::setupModelViewMatrix() const bool icvCheckGlError(const char* file, const int line, const char* func) { #ifndef HAVE_OPENGL + (void)file; + (void)line; + (void)func; return true; #else GLenum err = glGetError(); diff --git a/modules/core/test/test_countnonzero.cpp b/modules/core/test/test_countnonzero.cpp index 456f97a..7d0f2bb 100644 --- a/modules/core/test/test_countnonzero.cpp +++ b/modules/core/test/test_countnonzero.cpp @@ -82,7 +82,7 @@ private: void print_information(int right, int result); }; -CV_CountNonZeroTest::CV_CountNonZeroTest(): eps_32(1e-8), eps_64(1e-16), src(Mat()), current_type(-1) {} +CV_CountNonZeroTest::CV_CountNonZeroTest(): eps_32(1e-8f), eps_64(1e-16f), src(Mat()), current_type(-1) {} CV_CountNonZeroTest::~CV_CountNonZeroTest() {} void CV_CountNonZeroTest::generate_src_data(cv::Size size, int type) diff --git a/modules/core/test/test_eigen.cpp b/modules/core/test/test_eigen.cpp index 6b396df..200a727 100644 --- a/modules/core/test/test_eigen.cpp +++ b/modules/core/test/test_eigen.cpp @@ -165,7 +165,7 @@ void Core_EigenTest_Scalar_64::run(int) void Core_EigenTest_32::run(int) { check_full(CV_32FC1); } void Core_EigenTest_64::run(int) { check_full(CV_64FC1); } -Core_EigenTest::Core_EigenTest() : eps_val_32(1e-3), eps_vec_32(1e-2), eps_val_64(1e-4), eps_vec_64(1e-3) {} +Core_EigenTest::Core_EigenTest() : eps_val_32(1e-3f), eps_vec_32(1e-2f), eps_val_64(1e-4f), eps_vec_64(1e-3f) {} Core_EigenTest::~Core_EigenTest() {} bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues, int low_index, int high_index) @@ -387,7 +387,7 @@ bool Core_EigenTest::check_full(int type) const int MATRIX_COUNT = 500; const int MAX_DEGREE = 7; - srand(time(0)); + srand((unsigned int)time(0)); for (int i = 1; i <= MATRIX_COUNT; ++i) { diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index d709b21..4fe8421 100644 --- a/modules/features2d/src/fast.cpp +++ b/modules/features2d/src/fast.cpp @@ -280,7 +280,7 @@ void cv::FAST(const Mat& img, std::vector& keypoints, int threshold, b { cornerpos[ncorners++] = j+k; if(nonmax_suppression) - curr[j+k] = cornerScore(ptr+k, pixel, threshold); + curr[j+k] = (uchar)cornerScore(ptr+k, pixel, threshold); } } #endif @@ -318,7 +318,7 @@ void cv::FAST(const Mat& img, std::vector& keypoints, int threshold, b { cornerpos[ncorners++] = j; if(nonmax_suppression) - curr[j] = cornerScore(ptr, pixel, threshold); + curr[j] = (uchar)cornerScore(ptr, pixel, threshold); break; } } @@ -340,7 +340,7 @@ void cv::FAST(const Mat& img, std::vector& keypoints, int threshold, b { cornerpos[ncorners++] = j; if(nonmax_suppression) - curr[j] = cornerScore(ptr, pixel, threshold); + curr[j] = (uchar)cornerScore(ptr, pixel, threshold); break; } } diff --git a/modules/features2d/src/orb.cpp b/modules/features2d/src/orb.cpp index 9bc5580..97f2d7a 100644 --- a/modules/features2d/src/orb.cpp +++ b/modules/features2d/src/orb.cpp @@ -974,7 +974,7 @@ void ORB::computeKeyPoints(const vector& image_pyramid, * @param scale the scale at which we compute the orientation * @param keypoints the resulting keypoints */ -void ORB::computeOrientation(const Mat& image, const Mat&, unsigned int scale, +void ORB::computeOrientation(const Mat& image, const Mat&, unsigned int /*scale*/, vector& keypoints) const { int half_patch_size = params_.patch_size_/2; @@ -1003,7 +1003,7 @@ void ORB::computeIntegralImage(const Mat&, unsigned int, Mat&) * @param keypoints the keypoints to use * @param descriptors the resulting descriptors */ -void ORB::computeDescriptors(const Mat& image, const Mat& integral_image, unsigned int, +void ORB::computeDescriptors(const Mat& image, const Mat& /*integral_image*/, unsigned int, vector& keypoints, Mat& descriptors) const { //convert to grayscale if more than one color diff --git a/modules/flann/include/opencv2/flann/nn_index.h b/modules/flann/include/opencv2/flann/nn_index.h index 518babf..6aed20e 100644 --- a/modules/flann/include/opencv2/flann/nn_index.h +++ b/modules/flann/include/opencv2/flann/nn_index.h @@ -119,7 +119,7 @@ public: dists_ptr = dists[0]; } - RadiusUniqueResultSet resultSet(radius); + RadiusUniqueResultSet resultSet((DistanceType)radius); resultSet.clear(); findNeighbors(resultSet, query[0], params); if (n>0) { diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index f4ca508..8440ef2 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -1664,7 +1664,7 @@ private: GpuMat pattern_; std::vector imagePyr_; - std::vector maskPyr_; + cv::Ptr> maskPyr_; GpuMat buf_; diff --git a/modules/gpu/src/gftt.cpp b/modules/gpu/src/gftt.cpp index 869c155..f386ae9 100644 --- a/modules/gpu/src/gftt.cpp +++ b/modules/gpu/src/gftt.cpp @@ -130,7 +130,7 @@ void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat& image, if (!m.empty()) { - for(int j = 0; j < m.size(); j++) + for(size_t j = 0; j < m.size(); j++) { float dx = p.x - m[j].x; float dy = p.y - m[j].y; diff --git a/modules/gpu/src/orb.cpp b/modules/gpu/src/orb.cpp index 2854404..f0c1781 100644 --- a/modules/gpu/src/orb.cpp +++ b/modules/gpu/src/orb.cpp @@ -493,7 +493,7 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas CV_Assert(mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size())); imagePyr_.resize(params_.n_levels_); - maskPyr_.resize(params_.n_levels_); + maskPyr_->resize(params_.n_levels_); for (int level = 0; level < static_cast(params_.n_levels_); ++level) { @@ -502,8 +502,8 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas Size sz(cvRound(image.cols * scale), cvRound(image.rows * scale)); ensureSizeIsEnough(sz, image.type(), imagePyr_[level]); - ensureSizeIsEnough(sz, CV_8UC1, maskPyr_[level]); - maskPyr_[level].setTo(Scalar::all(255)); + ensureSizeIsEnough(sz, CV_8UC1, (*maskPyr_)[level]); + (*maskPyr_)[level].setTo(Scalar::all(255)); // Compute the resized image if (level != static_cast(params_.first_level_)) @@ -528,7 +528,7 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas image.copyTo(imagePyr_[level]); if (!mask.empty()) - mask.copyTo(maskPyr_[level]); + mask.copyTo((*maskPyr_)[level]); } // Filter keypoints by image border @@ -537,7 +537,7 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas Rect inner(params_.edge_threshold_, params_.edge_threshold_, sz.width - 2 * params_.edge_threshold_, sz.height - 2 * params_.edge_threshold_); buf_(inner).setTo(Scalar::all(255)); - bitwise_and(maskPyr_[level], buf_, maskPyr_[level]); + bitwise_and((*maskPyr_)[level], buf_, (*maskPyr_)[level]); } } @@ -573,7 +573,7 @@ void cv::gpu::ORB_GPU::computeKeyPointsPyramid() for (int level = 0; level < static_cast(params_.n_levels_); ++level) { - keyPointsCount_[level] = fastDetector_.calcKeyPointsLocation(imagePyr_[level], maskPyr_[level]); + keyPointsCount_[level] = fastDetector_.calcKeyPointsLocation(imagePyr_[level], (*maskPyr_)[level]); ensureSizeIsEnough(3, keyPointsCount_[level], CV_32FC1, keyPointsPyr_[level]); @@ -752,7 +752,7 @@ void cv::gpu::ORB_GPU::operator()(const GpuMat& image, const GpuMat& mask, std:: void cv::gpu::ORB_GPU::release() { imagePyr_.clear(); - maskPyr_.clear(); + maskPyr_->clear(); buf_.release(); diff --git a/modules/gpu/test/test_features2d.cpp b/modules/gpu/test/test_features2d.cpp index 3fe6a1b..e979090 100644 --- a/modules/gpu/test/test_features2d.cpp +++ b/modules/gpu/test/test_features2d.cpp @@ -267,7 +267,7 @@ TEST_P(BruteForceMatcher, MatchAdd) cv::DMatch match = matches[i]; int shift = isMaskSupported ? 1 : 0; { - if (i < queryDescCount / 2) + if ((int)i < queryDescCount / 2) { if ((match.queryIdx != (int)i) || (match.trainIdx != (int)i * countFactor + shift) || (match.imgIdx != 0)) badCount++; @@ -390,7 +390,7 @@ TEST_P(BruteForceMatcher, KnnMatchAdd2) { cv::DMatch match = matches[i][k]; { - if (i < queryDescCount / 2) + if ((int)i < queryDescCount / 2) { if ((match.queryIdx != (int)i) || (match.trainIdx != (int)i * countFactor + k + shift) || (match.imgIdx != 0) ) localBadCount++; @@ -452,7 +452,7 @@ TEST_P(BruteForceMatcher, KnnMatchAdd3) { cv::DMatch match = matches[i][k]; { - if (i < queryDescCount / 2) + if ((int)i < queryDescCount / 2) { if ((match.queryIdx != (int)i) || (match.trainIdx != (int)i * countFactor + k + shift) || (match.imgIdx != 0) ) localBadCount++; @@ -552,7 +552,7 @@ TEST_P(BruteForceMatcher, RadiusMatchAdd) { cv::DMatch match = matches[i][k]; { - if (i < queryDescCount / 2) + if ((int)i < queryDescCount / 2) { if ((match.queryIdx != (int)i) || (match.trainIdx != (int)i * countFactor + k + shift) || (match.imgIdx != 0) ) localBadCount++; diff --git a/modules/highgui/src/cap_openni.cpp b/modules/highgui/src/cap_openni.cpp index 74bc74a..c470be7 100644 --- a/modules/highgui/src/cap_openni.cpp +++ b/modules/highgui/src/cap_openni.cpp @@ -401,7 +401,7 @@ double CvCapture_OpenNI::getDepthGeneratorProperty( int propIdx ) res = baseline; break; case CV_CAP_PROP_OPENNI_FOCAL_LENGTH : - res = depthFocalLength_VGA; + res = (double)depthFocalLength_VGA; break; case CV_CAP_PROP_OPENNI_REGISTRATION : res = depthGenerator.GetAlternativeViewPointCap().IsViewPointAs(imageGenerator) ? 1.0 : 0.0; @@ -552,7 +552,7 @@ inline void getDepthMapFromMetaData( const xn::DepthMetaData& depthMetaData, cv: // CV_Assert( sizeof(unsigned short) == sizeof(XnDepthPixel) ); memcpy( depthMap.data, pDepthMap, cols*rows*sizeof(XnDepthPixel) ); - cv::Mat badMask = (depthMap == noSampleValue) | (depthMap == shadowValue) | (depthMap == 0); + cv::Mat badMask = (depthMap == (double)noSampleValue) | (depthMap == (double)shadowValue) | (depthMap == 0); // mask the pixels with invalid depth depthMap.setTo( cv::Scalar::all( CvCapture_OpenNI::INVALID_PIXEL_VAL ), badMask ); @@ -588,8 +588,8 @@ IplImage* CvCapture_OpenNI::retrievePointCloudMap() for( int x = 0; x < cols; x++ ) { int ind = y*cols+x; - proj[ind].X = x; - proj[ind].Y = y; + proj[ind].X = (float)x; + proj[ind].Y = (float)y; proj[ind].Z = depth.at(y, x); } } @@ -625,7 +625,7 @@ void computeDisparity_32F( const xn::DepthMetaData& depthMetaData, cv::Mat& disp // disparity = baseline * F / z; - float mult = baseline /*mm*/ * F /*pixels*/; + float mult = (float)(baseline /*mm*/ * F /*pixels*/); disp.create( depth.size(), CV_32FC1); disp = cv::Scalar::all( CvCapture_OpenNI::INVALID_PIXEL_VAL ); diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index 70235f0..5601134 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -393,6 +393,9 @@ void cv::pointCloudShow(const string& winname, const GlCamera& camera, const GlA { #ifndef HAVE_OPENGL CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support"); + (void)winname; + (void)camera; + (void)arr; #else namedWindow(winname, WINDOW_OPENGL); @@ -436,6 +439,10 @@ void cv::pointCloudShow(const string& winname, const GlCamera& camera, const GlA void cv::pointCloudShow(const std::string& winname, const cv::GlCamera& camera, InputArray points, InputArray colors) { #ifndef HAVE_OPENGL + (void)winname; + (void)camera; + (void)points; + (void)colors; CV_Error(CV_OpenGlNotSupported, "The library is compiled without OpenGL support"); #else namedWindow(winname, WINDOW_OPENGL); diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp index 37a0177..c52ab81 100644 --- a/modules/highgui/src/window_w32.cpp +++ b/modules/highgui/src/window_w32.cpp @@ -560,6 +560,7 @@ double cvGetOpenGlProp_W32(const char* name) __END__; #endif + (void)name; return result; } diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index c87f31c..5aa000c 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -32,7 +32,7 @@ PERF_TEST_P( TestFilter2d, Filter2d, Mat kernel(kSize, kSize, CV_32FC1); randu(kernel, -3, 10); - float s = fabs( sum(kernel)[0] ); + float s = (float)fabs( sum(kernel)[0] ); if(s > 1e-3) kernel /= s; declare.in(src, WARMUP_RNG).out(dst).time(20); diff --git a/modules/imgproc/src/gabor.cpp b/modules/imgproc/src/gabor.cpp index 5a81312..867fa1a 100644 --- a/modules/imgproc/src/gabor.cpp +++ b/modules/imgproc/src/gabor.cpp @@ -60,12 +60,12 @@ cv::Mat cv::getGaborKernel( Size ksize, double sigma, double theta, if( ksize.width > 0 ) xmax = ksize.width/2; else - xmax = std::max(fabs(nstds*sigma_x*c), fabs(nstds*sigma_y*s)); + xmax = (int)std::max(fabs(nstds*sigma_x*c), fabs(nstds*sigma_y*s)); if( ksize.height > 0 ) ymax = ksize.height/2; else - ymax = std::max(fabs(nstds*sigma_x*s), fabs(nstds*sigma_y*c)); + ymax = (int)std::max(fabs(nstds*sigma_x*s), fabs(nstds*sigma_y*c)); xmin = -xmax; ymin = -ymax; diff --git a/modules/imgproc/src/geometry.cpp b/modules/imgproc/src/geometry.cpp index 66d0291..63bab60 100644 --- a/modules/imgproc/src/geometry.cpp +++ b/modules/imgproc/src/geometry.cpp @@ -439,8 +439,8 @@ static char segSegInt( Point2f a, Point2f b, Point2f c, Point2f d, Point2f& p, P (0.0 > t) || (t > 1.0) ) code = '0'; - p.x = a.x + s * ( b.x - a.x ); - p.y = a.y + s * ( b.y - a.y ); + p.x = (float)(a.x + s * ( b.x - a.x )); + p.y = (float)(a.y + s * ( b.y - a.y )); return code; } @@ -652,7 +652,7 @@ float cv::intersectConvexConvex( InputArray _p1, InputArray _p2, OutputArray _p1 _p12.release(); return 0.f; } - area = contourArea(_InputArray(result, nr), false); + area = (float)contourArea(_InputArray(result, nr), false); } if( _p12.needed() ) diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 9fa1d59..d8921b5 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -1074,10 +1074,8 @@ public: { int row0 = min(cvRound(range.begin() * src.rows / nStripes), src.rows); int row1 = min(cvRound(range.end() * src.rows / nStripes), src.rows); - - if(0) - printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n", - src.rows, src.cols, range.begin(), range.end(), row0, row1); + + //printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n", src.rows, src.cols, range.begin(), range.end(), row0, row1); Mat srcStripe = src.rowRange(row0, row1); Mat dstStripe = dst.rowRange(row0, row1); @@ -1102,6 +1100,9 @@ private: int rowBorderType; int columnBorderType; const Scalar& borderValue; + + MorphologyRunner(const MorphologyRunner&); + MorphologyRunner& operator=(const MorphologyRunner&); }; static void morphOp( int op, InputArray _src, OutputArray _dst, diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 14c5b16..f200890 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -682,10 +682,8 @@ public: { int row0 = std::min(cvRound(range.begin() * src.rows / nStripes), src.rows); int row1 = std::min(cvRound(range.end() * src.rows / nStripes), src.rows); - - if(0) - printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n", - src.rows, src.cols, range.begin(), range.end(), row0, row1); + + //printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n", src.rows, src.cols, range.begin(), range.end(), row0, row1); Mat srcStripe = src.rowRange(row0, row1); Mat dstStripe = dst.rowRange(row0, row1); diff --git a/modules/stitching/include/opencv2/stitching/detail/util.hpp b/modules/stitching/include/opencv2/stitching/detail/util.hpp index 1887f6b..ddbe932 100644 --- a/modules/stitching/include/opencv2/stitching/detail/util.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/util.hpp @@ -62,18 +62,21 @@ } while(0); #else #include - #define LOG_STITCHING_MSG(msg) do { std::cout << msg; std::cout.flush(); } while(0); + #define LOG_STITCHING_MSG(msg) for(;;) { std::cout << msg; std::cout.flush(); break; } #endif #else #define LOG_STITCHING_MSG(msg) #endif #define LOG_(_level, _msg) \ - do { \ - if ((_level) >= ::cv::detail::stitchingLogLevel()) { \ + for(;;) \ + { \ + if ((_level) >= ::cv::detail::stitchingLogLevel()) \ + { \ LOG_STITCHING_MSG(_msg); \ } \ - } while(0) + break; \ + } #define LOG(msg) LOG_(1, msg) diff --git a/modules/stitching/perf/perf_stich.cpp b/modules/stitching/perf/perf_stich.cpp index 0898aa5..81d8bc0 100644 --- a/modules/stitching/perf/perf_stich.cpp +++ b/modules/stitching/perf/perf_stich.cpp @@ -87,8 +87,8 @@ PERF_TEST_P( match, bestOf2Nearest, testing::Values("surf", "orb")) { Mat img1, img1_full = imread( getDataPath("stitching/b1.jpg") ); Mat img2, img2_full = imread( getDataPath("stitching/b2.jpg") ); - float scale1 = std::min(1.0, sqrt(WORK_MEGAPIX * 1e6 / img1_full.total())); - float scale2 = std::min(1.0, sqrt(WORK_MEGAPIX * 1e6 / img2_full.total())); + float scale1 = (float)std::min(1.0, sqrt(WORK_MEGAPIX * 1e6 / img1_full.total())); + float scale2 = (float)std::min(1.0, sqrt(WORK_MEGAPIX * 1e6 / img2_full.total())); resize(img1_full, img1, Size(), scale1, scale1); resize(img2_full, img2, Size(), scale2, scale2); diff --git a/modules/stitching/src/seam_finders.cpp b/modules/stitching/src/seam_finders.cpp index 9350307..13a670e 100644 --- a/modules/stitching/src/seam_finders.cpp +++ b/modules/stitching/src/seam_finders.cpp @@ -158,6 +158,8 @@ public: Impl(int cost_type, float terminal_cost, float bad_region_penalty) : cost_type_(cost_type), terminal_cost_(terminal_cost), bad_region_penalty_(bad_region_penalty) {} + ~Impl() {} + void find(const vector &src, const vector &corners, vector &masks); void findInPair(size_t first, size_t second, Rect roi); diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index a29ff46..302e32d 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -985,6 +985,7 @@ TestBase::_declareHelper& TestBase::_declareHelper::tbb_threads(int n) if (n > 0) test->p_tbb_initializer=new tbb::task_scheduler_init(n); #endif + (void)n; return *this; } -- 2.7.4