From c09254cf67e0305b7f3493fcab48c89a725f199b Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Mon, 11 Oct 2010 15:46:12 +0000 Subject: [PATCH] fixed some warning under VS2008 --- modules/features2d/src/descriptors.cpp | 6 +++--- modules/features2d/src/evaluation.cpp | 11 ++++++----- modules/gpu/FindNPP.cmake | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/features2d/src/descriptors.cpp b/modules/features2d/src/descriptors.cpp index 79fb382f8..a3d0e6518 100644 --- a/modules/features2d/src/descriptors.cpp +++ b/modules/features2d/src/descriptors.cpp @@ -196,7 +196,7 @@ void convertBGRImageToOpponentColorSpace( const Mat& bgrImage, vector& oppo MatConstIterator_ rIt = bgrChannels[2].begin(); MatConstIterator_ gIt = bgrChannels[1].begin(); MatIterator_ dstIt = opponentChannels[0].begin(); - float factor = 1.f / sqrt(2.0); + float factor = 1.f / sqrt(2.f); for( ; dstIt != opponentChannels[0].end(); ++rIt, ++gIt, ++dstIt ) { int value = static_cast( static_cast(static_cast(*gIt)-static_cast(*rIt)) * factor ); @@ -211,7 +211,7 @@ void convertBGRImageToOpponentColorSpace( const Mat& bgrImage, vector& oppo MatConstIterator_ gIt = bgrChannels[1].begin(); MatConstIterator_ bIt = bgrChannels[0].begin(); MatIterator_ dstIt = opponentChannels[1].begin(); - float factor = 1.f / sqrt(6.0); + float factor = 1.f / sqrt(6.f); for( ; dstIt != opponentChannels[1].end(); ++rIt, ++gIt, ++bIt, ++dstIt ) { int value = static_cast( static_cast(static_cast(*rIt) + static_cast(*gIt) - 2*static_cast(*bIt)) * @@ -227,7 +227,7 @@ void convertBGRImageToOpponentColorSpace( const Mat& bgrImage, vector& oppo MatConstIterator_ gIt = bgrChannels[1].begin(); MatConstIterator_ bIt = bgrChannels[0].begin(); MatIterator_ dstIt = opponentChannels[2].begin(); - float factor = 1.f / sqrt(3.0); + float factor = 1.f / sqrt(3.f); for( ; dstIt != opponentChannels[2].end(); ++rIt, ++gIt, ++bIt, ++dstIt ) { int value = static_cast( static_cast(static_cast(*rIt) + static_cast(*gIt) + static_cast(*bIt)) * diff --git a/modules/features2d/src/evaluation.cpp b/modules/features2d/src/evaluation.cpp index 50f949571..22541234f 100644 --- a/modules/features2d/src/evaluation.cpp +++ b/modules/features2d/src/evaluation.cpp @@ -229,7 +229,7 @@ struct IntersectAreaCounter { float rx1 = minx + i*dr; float rx2 = rx1 - diff.x; - for( float ry1 = miny; ry1 <= maxy; ry1 += dr ) + for( float ry1 = (float)miny; ry1 <= (float)maxy; ry1 += dr ) { float ry2 = ry1 - diff.y; //compute the distance from the ellipse center @@ -276,6 +276,7 @@ struct SIdx UsedFinder(const SIdx& _used) : used(_used) {} const SIdx& used; bool operator()(const SIdx& v) const { return (v.i1 == used.i1 || v.i2 == used.i2); } + UsedFinder& operator=(const UsedFinder&); }; }; @@ -312,14 +313,14 @@ static void computeOneToOneMatchedOverlaps( const vector& keyp { EllipticKeyPoint keypoint2a = EllipticKeyPoint( kp2.center, Scalar(fac*kp2.ellipse[0], fac*kp2.ellipse[1], fac*kp2.ellipse[2]) ); //find the largest eigenvalue - int maxx = ceil(( keypoint1a.boundingBox.width > (diff.x+keypoint2a.boundingBox.width)) ? + int maxx = (int)ceil(( keypoint1a.boundingBox.width > (diff.x+keypoint2a.boundingBox.width)) ? keypoint1a.boundingBox.width : (diff.x+keypoint2a.boundingBox.width)); - int minx = floor((-keypoint1a.boundingBox.width < (diff.x-keypoint2a.boundingBox.width)) ? + int minx = (int)floor((-keypoint1a.boundingBox.width < (diff.x-keypoint2a.boundingBox.width)) ? -keypoint1a.boundingBox.width : (diff.x-keypoint2a.boundingBox.width)); - int maxy = ceil(( keypoint1a.boundingBox.height > (diff.y+keypoint2a.boundingBox.height)) ? + int maxy = (int)ceil(( keypoint1a.boundingBox.height > (diff.y+keypoint2a.boundingBox.height)) ? keypoint1a.boundingBox.height : (diff.y+keypoint2a.boundingBox.height)); - int miny = floor((-keypoint1a.boundingBox.height < (diff.y-keypoint2a.boundingBox.height)) ? + int miny = (int)floor((-keypoint1a.boundingBox.height < (diff.y-keypoint2a.boundingBox.height)) ? -keypoint1a.boundingBox.height : (diff.y-keypoint2a.boundingBox.height)); int mina = (maxx-minx) < (maxy-miny) ? (maxx-minx) : (maxy-miny) ; diff --git a/modules/gpu/FindNPP.cmake b/modules/gpu/FindNPP.cmake index 51d4731ce..04c3f5bce 100644 --- a/modules/gpu/FindNPP.cmake +++ b/modules/gpu/FindNPP.cmake @@ -86,7 +86,7 @@ if(NOT EXISTS ${CUDA_NPP_LIBRARIES} OR NOT EXISTS ${CUDA_NPP_INCLUDES}/npp.h) if(NPP_FIND_REQUIRED) message(FATAL_ERROR "NPP headers/libraries are not found. Specify CUDA_NPP_LIBRARY_ROOT_DIR.") elseif(NOT CUDA_FIND_QUIETLY) - message("NPP headers/libraries are not found or CUDA_NPP_LIBRARY_ROOT_DIR not specified.") + message("NPP headers/libraries are not found. Please specify CUDA_NPP_LIBRARY_ROOT_DIR in CMake or set $NPP_ROOT_DIR.") endif() else()