Skip to content

Commit d879ea4

Browse files
committed
Merge pull request #977 from oqtvs:fixIssue975
2 parents 0b3b096 + bd447c0 commit d879ea4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

modules/xfeatures2d/src/boostdesc.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,16 @@ static void computeGradientMaps( const Mat& im,
232232
break;
233233

234234
case ASSIGN_HARD_MAGN:
235-
gradMap[index].at<uchar>(i,j) = (uchar) round( gradMagnitude );
235+
gradMap[index].at<uchar>(i,j) = (uchar) cvRound( gradMagnitude );
236236
break;
237237

238238
case ASSIGN_BILINEAR:
239239
index2 = (int) ceil( theta / binSize );
240240
index2 = ( index2 == orientQuant ) ? 0 : index2;
241241
binCenter = ( index + 0.5f ) * binSize;
242242
weight = 1 - abs( theta - binCenter ) / binSize;
243-
gradMap[index ].at<uchar>(i,j) = (uchar) round( 255 * weight );
244-
gradMap[index2].at<uchar>(i,j) = (uchar) round( 255 * ( 1 - weight ) );
243+
gradMap[index ].at<uchar>(i,j) = (uchar) cvRound( 255 * weight );
244+
gradMap[index2].at<uchar>(i,j) = (uchar) cvRound( 255 * ( 1 - weight ) );
245245
break;
246246

247247
case ASSIGN_SOFT:
@@ -251,7 +251,7 @@ static void computeGradientMaps( const Mat& im,
251251
binCenter = ( index2 + 0.5f ) * binSize;
252252
weight = cos( theta - binCenter );
253253
weight = ( weight < 0 ) ? 0 : weight;
254-
gradMap[index2].at<uchar>(i,j) = (uchar) round( 255 * weight );
254+
gradMap[index2].at<uchar>(i,j) = (uchar) cvRound( 255 * weight );
255255
}
256256
break;
257257

@@ -262,7 +262,7 @@ static void computeGradientMaps( const Mat& im,
262262
binCenter = ( index2 + 0.5f ) * binSize;
263263
weight = cos( theta - binCenter );
264264
weight = ( weight < 0 ) ? 0 : weight;
265-
gradMap[index2].at<uchar>(i,j) = (uchar) round( gradMagnitude * weight );
265+
gradMap[index2].at<uchar>(i,j) = (uchar) cvRound( gradMagnitude * weight );
266266
}
267267
break;
268268
} // end switch

modules/xfeatures2d/src/harris_lapace_detector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void Pyramid::build(const Mat& img, bool DOG)
104104

105105
Size imgSize = img.size();
106106
int minSize = MIN(imgSize.width, imgSize.height);
107-
int octavesN = MIN(params.octavesN, int(floor(log((double) minSize)/log(2))));
107+
int octavesN = MIN(params.octavesN, int(floor(log((double) minSize)/log((float)2))));
108108
float sigma0 = params.sigma0;
109109
float sigma = sigma0;
110110
int layersN = params.layersN + 3;

modules/xfeatures2d/src/pct_signatures.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ namespace cv
397397
break;
398398
case REGULAR:
399399
{
400-
int gridSize = (int)ceil(sqrt(count));
400+
int gridSize = (int)ceil(sqrt((float)count));
401401
const float step = 1.0f / gridSize;
402402
const float halfStep = step / 2;
403403
float x = halfStep;

0 commit comments

Comments
 (0)