Skip to content

Commit 2d169a7

Browse files
committed
gdal_homography.cpp: use std::abs()
1 parent d04732f commit 2d169a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

alg/gdal_homography.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ int GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPList,
262262
{
263263
return FALSE;
264264
}
265-
if (abs(h_normalized(6, 0)) < 1.0e-15)
265+
if (std::abs(h_normalized(6, 0)) < 1.0e-15)
266266
{
267267
return FALSE;
268268
}
@@ -366,11 +366,11 @@ void GDALComposeHomographies(const double *padfH1, const double *padfH2,
366366
* into a georeferenced (geo_x, geo_y) location.
367367
* \code{.c}
368368
* *pdfGeoX = (padfHomography[0] + dfPixel * padfHomography[1]
369-
* + dfLine * padfHomography[2]) /
369+
* + dfLine * padfHomography[2]) /
370370
* (padfHomography[6] + dfPixel * padfHomography[7]
371371
* + dfLine * padfHomography[8]);
372372
* *pdfGeoY = (padfHomography[3] + dfPixel * padfHomography[4]
373-
* + dfLine * padfHomography[5]) /
373+
* + dfLine * padfHomography[5]) /
374374
* (padfHomography[6] + dfPixel * padfHomography[7]
375375
* + dfLine * padfHomography[8]);
376376
* \endcode
@@ -391,7 +391,7 @@ int GDALApplyHomography(const double *padfHomography, double dfPixel,
391391
{
392392
double w = padfHomography[6] + dfPixel * padfHomography[7] +
393393
dfLine * padfHomography[8];
394-
if (abs(w) < 1.0e-15)
394+
if (std::abs(w) < 1.0e-15)
395395
{
396396
return FALSE;
397397
}
@@ -570,7 +570,7 @@ int GDALHomographyTransform(void *pTransformArg, int bDstToSrc, int nPointCount,
570570
for (int i = 0; i < nPointCount; i++)
571571
{
572572
double w = homography[6] + x[i] * homography[7] + y[i] * homography[8];
573-
if (abs(w) < 1.0e-15)
573+
if (std::abs(w) < 1.0e-15)
574574
{
575575
panSuccess[i] = FALSE;
576576
ret = FALSE;

0 commit comments

Comments
 (0)