Merge pull request #977 from oqtvs:fixIssue975

pull/978/head
Alexander Alekhin 8 years ago
commit d879ea48b6
  1. 10
      modules/xfeatures2d/src/boostdesc.cpp
  2. 2
      modules/xfeatures2d/src/harris_lapace_detector.cpp
  3. 2
      modules/xfeatures2d/src/pct_signatures.cpp

@ -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,
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,
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,
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)
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
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;

Loading…
Cancel
Save