We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is similar to #461, but applies to the cahvor distortion model.
For cahvor distortion, the formula (https://github.com/DOI-USGS/usgscsm/blob/main/src/Distortion.cpp#L325) is:
double rr = shiftedDx * shiftedDx + shiftedDy * shiftedDy; if (rr > tolerance) { double dr = opticalDistCoeffs[0] + (rr * (opticalDistCoeffs[1] + rr * opticalDistCoeffs[2])); ux = shiftedDx * (1.0 - dr); uy = shiftedDy * (1.0 - dr); ux += opticalDistCoeffs[3]; uy += opticalDistCoeffs[4]; } } break;
When rr is smaller than tolerance, the undistortion ux and uy is assumed to be equal to input distorted values, which is wrong.
Need to add the optical shifts given by opticalDistCoeffs[3] and [4] even when rr is small.
This formula should not have an if statement at all. This is a simple polynomial formula, that works for any input.
The same for cahvor undistortion, at https://github.com/DOI-USGS/usgscsm/blob/main/src/Distortion.cpp#L585
There is no need to consider a tolerance. The only division by a value is:
dx = shiftedUx / (1.0 - drOverR); dy = shiftedUy / (1.0 - drOverR);
and here it doesn't matter if we are close to the origin, as that does not make 1.0 - drOverR be equal to 0, rather, this quantity is close to 1.0.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is similar to #461, but applies to the cahvor distortion model.
For cahvor distortion, the formula (https://github.com/DOI-USGS/usgscsm/blob/main/src/Distortion.cpp#L325) is:
When rr is smaller than tolerance, the undistortion ux and uy is assumed to be equal to input distorted values, which is wrong.
Need to add the optical shifts given by opticalDistCoeffs[3] and [4] even when rr is small.
This formula should not have an if statement at all. This is a simple polynomial formula, that works for any input.
The same for cahvor undistortion, at https://github.com/DOI-USGS/usgscsm/blob/main/src/Distortion.cpp#L585
There is no need to consider a tolerance. The only division by a value is:
dx = shiftedUx / (1.0 - drOverR);
dy = shiftedUy / (1.0 - drOverR);
and here it doesn't matter if we are close to the origin, as that does not make 1.0 - drOverR be equal to 0, rather, this quantity is close to 1.0.
The text was updated successfully, but these errors were encountered: