Commit bd447c0f authored by oqtvs's avatar oqtvs

Fixed issue 975 - fixed visual studio 2010 build errors on module xfeatures2d

parent 0b3b096f
...@@ -232,7 +232,7 @@ static void computeGradientMaps( const Mat& im, ...@@ -232,7 +232,7 @@ static void computeGradientMaps( const Mat& im,
break; break;
case ASSIGN_HARD_MAGN: case ASSIGN_HARD_MAGN:
gradMap[index].at<uchar>(i,j) = (uchar) round( gradMagnitude ); gradMap[index].at<uchar>(i,j) = (uchar) cvRound( gradMagnitude );
break; break;
case ASSIGN_BILINEAR: case ASSIGN_BILINEAR:
...@@ -240,8 +240,8 @@ static void computeGradientMaps( const Mat& im, ...@@ -240,8 +240,8 @@ static void computeGradientMaps( const Mat& im,
index2 = ( index2 == orientQuant ) ? 0 : index2; index2 = ( index2 == orientQuant ) ? 0 : index2;
binCenter = ( index + 0.5f ) * binSize; binCenter = ( index + 0.5f ) * binSize;
weight = 1 - abs( theta - binCenter ) / binSize; weight = 1 - abs( theta - binCenter ) / binSize;
gradMap[index ].at<uchar>(i,j) = (uchar) round( 255 * weight ); gradMap[index ].at<uchar>(i,j) = (uchar) cvRound( 255 * weight );
gradMap[index2].at<uchar>(i,j) = (uchar) round( 255 * ( 1 - weight ) ); gradMap[index2].at<uchar>(i,j) = (uchar) cvRound( 255 * ( 1 - weight ) );
break; break;
case ASSIGN_SOFT: case ASSIGN_SOFT:
...@@ -251,7 +251,7 @@ static void computeGradientMaps( const Mat& im, ...@@ -251,7 +251,7 @@ static void computeGradientMaps( const Mat& im,
binCenter = ( index2 + 0.5f ) * binSize; binCenter = ( index2 + 0.5f ) * binSize;
weight = cos( theta - binCenter ); weight = cos( theta - binCenter );
weight = ( weight < 0 ) ? 0 : weight; weight = ( weight < 0 ) ? 0 : weight;
gradMap[index2].at<uchar>(i,j) = (uchar) round( 255 * weight ); gradMap[index2].at<uchar>(i,j) = (uchar) cvRound( 255 * weight );
} }
break; break;
...@@ -262,7 +262,7 @@ static void computeGradientMaps( const Mat& im, ...@@ -262,7 +262,7 @@ static void computeGradientMaps( const Mat& im,
binCenter = ( index2 + 0.5f ) * binSize; binCenter = ( index2 + 0.5f ) * binSize;
weight = cos( theta - binCenter ); weight = cos( theta - binCenter );
weight = ( weight < 0 ) ? 0 : weight; weight = ( weight < 0 ) ? 0 : weight;
gradMap[index2].at<uchar>(i,j) = (uchar) round( gradMagnitude * weight ); gradMap[index2].at<uchar>(i,j) = (uchar) cvRound( gradMagnitude * weight );
} }
break; break;
} // end switch } // end switch
......
...@@ -104,7 +104,7 @@ void Pyramid::build(const Mat& img, bool DOG) ...@@ -104,7 +104,7 @@ void Pyramid::build(const Mat& img, bool DOG)
Size imgSize = img.size(); Size imgSize = img.size();
int minSize = MIN(imgSize.width, imgSize.height); 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 sigma0 = params.sigma0;
float sigma = sigma0; float sigma = sigma0;
int layersN = params.layersN + 3; int layersN = params.layersN + 3;
......
...@@ -397,7 +397,7 @@ namespace cv ...@@ -397,7 +397,7 @@ namespace cv
break; break;
case REGULAR: case REGULAR:
{ {
int gridSize = (int)ceil(sqrt(count)); int gridSize = (int)ceil(sqrt((float)count));
const float step = 1.0f / gridSize; const float step = 1.0f / gridSize;
const float halfStep = step / 2; const float halfStep = step / 2;
float x = halfStep; float x = halfStep;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment