Remove scale parameter from distortion correction

Scale is no longer useful in LensCorrection::correctDistortion. Remove
the scale parameter from the functions.
This commit is contained in:
Lawrence
2020-01-02 18:33:35 -08:00
parent 512517327f
commit b266cb7ca3
5 changed files with 16 additions and 20 deletions

View File

@@ -1030,16 +1030,16 @@ bool rtengine::LCPMapper::isCACorrectionAvailable() const
return enableCA;
}
void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy, double scale) const
void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy) const
{
x += cx;
y += cy;
if (isFisheye) {
const double u = x * scale;
const double v = y * scale;
const double u0 = mc.x0 * scale;
const double v0 = mc.y0 * scale;
const double u = x;
const double v = y;
const double u0 = mc.x0;
const double v0 = mc.y0;
const double du = (u - u0);
const double dv = (v - v0);
const double fx = mc.fx;
@@ -1047,7 +1047,7 @@ void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy
const double k1 = mc.param[0];
const double k2 = mc.param[1];
const double r = sqrt(du * du + dv * dv);
const double f = sqrt(fx*fy / (scale * scale));
const double f = sqrt(fx*fy);
const double th = atan2(r, f);
const double th2 = th * th;
const double cfact = (((k2 * th2 + k1) * th2 + 1) * th) / r;
@@ -1057,10 +1057,8 @@ void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy
x = ud;
y = vd;
} else {
x *= scale;
y *= scale;
const double x0 = mc.x0 * scale;
const double y0 = mc.y0 * scale;
const double x0 = mc.x0;
const double y0 = mc.y0;
const double xd = (x - x0) / mc.fx, yd = (y - y0) / mc.fy;
const LCPModelCommon::Param aDist = mc.param;
@@ -1077,8 +1075,8 @@ void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy
y = ynew * mc.fy + y0;
}
x -= cx * scale;
y -= cy * scale;
x -= cx;
y -= cy;
}
void rtengine::LCPMapper::correctCA(double& x, double& y, int cx, int cy, int channel) const