From bd447c0f02ff3b40b2f091876d8e4c8870899d9b Mon Sep 17 00:00:00 2001 From: oqtvs Date: Mon, 30 Jan 2017 22:21:47 -0200 Subject: [PATCH] Fixed issue 975 - fixed visual studio 2010 build errors on module xfeatures2d --- modules/xfeatures2d/src/boostdesc.cpp | 10 +++++----- modules/xfeatures2d/src/harris_lapace_detector.cpp | 2 +- modules/xfeatures2d/src/pct_signatures.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/xfeatures2d/src/boostdesc.cpp b/modules/xfeatures2d/src/boostdesc.cpp index 89b4cfbce..5f99c5321 100644 --- a/modules/xfeatures2d/src/boostdesc.cpp +++ b/modules/xfeatures2d/src/boostdesc.cpp @@ -232,7 +232,7 @@ static void computeGradientMaps( const Mat& im, break; case ASSIGN_HARD_MAGN: - gradMap[index].at(i,j) = (uchar) round( gradMagnitude ); + gradMap[index].at(i,j) = (uchar) cvRound( gradMagnitude ); break; case ASSIGN_BILINEAR: @@ -240,8 +240,8 @@ static void computeGradientMaps( const Mat& im, index2 = ( index2 == orientQuant ) ? 0 : index2; binCenter = ( index + 0.5f ) * binSize; weight = 1 - abs( theta - binCenter ) / binSize; - gradMap[index ].at(i,j) = (uchar) round( 255 * weight ); - gradMap[index2].at(i,j) = (uchar) round( 255 * ( 1 - weight ) ); + gradMap[index ].at(i,j) = (uchar) cvRound( 255 * weight ); + gradMap[index2].at(i,j) = (uchar) cvRound( 255 * ( 1 - weight ) ); break; case ASSIGN_SOFT: @@ -251,7 +251,7 @@ static void computeGradientMaps( const Mat& im, binCenter = ( index2 + 0.5f ) * binSize; weight = cos( theta - binCenter ); weight = ( weight < 0 ) ? 0 : weight; - gradMap[index2].at(i,j) = (uchar) round( 255 * weight ); + gradMap[index2].at(i,j) = (uchar) cvRound( 255 * weight ); } break; @@ -262,7 +262,7 @@ static void computeGradientMaps( const Mat& im, binCenter = ( index2 + 0.5f ) * binSize; weight = cos( theta - binCenter ); weight = ( weight < 0 ) ? 0 : weight; - gradMap[index2].at(i,j) = (uchar) round( gradMagnitude * weight ); + gradMap[index2].at(i,j) = (uchar) cvRound( gradMagnitude * weight ); } break; } // end switch diff --git a/modules/xfeatures2d/src/harris_lapace_detector.cpp b/modules/xfeatures2d/src/harris_lapace_detector.cpp index a76dfd37a..6c68117c4 100644 --- a/modules/xfeatures2d/src/harris_lapace_detector.cpp +++ b/modules/xfeatures2d/src/harris_lapace_detector.cpp @@ -104,7 +104,7 @@ void Pyramid::build(const Mat& img, bool DOG) Size imgSize = img.size(); int minSize = MIN(imgSize.width, imgSize.height); - int octavesN = MIN(params.octavesN, int(floor(log((double) minSize)/log(2)))); + int octavesN = MIN(params.octavesN, int(floor(log((double) minSize)/log((float)2)))); float sigma0 = params.sigma0; float sigma = sigma0; int layersN = params.layersN + 3; diff --git a/modules/xfeatures2d/src/pct_signatures.cpp b/modules/xfeatures2d/src/pct_signatures.cpp index da0b57c45..100e1e1a3 100644 --- a/modules/xfeatures2d/src/pct_signatures.cpp +++ b/modules/xfeatures2d/src/pct_signatures.cpp @@ -397,7 +397,7 @@ namespace cv break; case REGULAR: { - int gridSize = (int)ceil(sqrt(count)); + int gridSize = (int)ceil(sqrt((float)count)); const float step = 1.0f / gridSize; const float halfStep = step / 2; float x = halfStep;