Skip to content
Snippets Groups Projects
Unverified Commit 62d3a746 authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Merge pull request #241 from AustinSanders/dev

Fixed matrix inversion in computeDistortedFocalPlaneCoordinates
parents 85887e1c 9cf090a0
Branches
Tags
No related merge requests found
......@@ -87,10 +87,10 @@ void computeDistortedFocalPlaneCoordinates(
double t1 = detLine - lineOrigin - iTransL[0];
double t2 = detSample - sampleOrigin - iTransS[0];
double determinant = m11 * m22 - m12 * m21;
double p11 = m11 / determinant;
double p11 = m22 / determinant;
double p12 = -m12 / determinant;
double p21 = -m21 / determinant;
double p22 = m22 / determinant;
double p22 = m11 / determinant;
distortedX = p11 * t1 + p12 * t2;
distortedY = p21 * t1 + p22 * t2;
......
......@@ -81,6 +81,22 @@ TEST(UtilitiesTests, computeDistortedFocalPlaneCoordinatesSumming) {
EXPECT_DOUBLE_EQ(undistortedFocalPlaneY, 0);
}
TEST(UtilitiesTests, computeDistortedFocalPlaneCoordinatesAffine) {
double iTransS[] = {-10.0, 0.0, 0.1};
double iTransL[] = {10.0, -0.1, 0.0};
double undistortedFocalPlaneX, undistortedFocalPlaneY;
computeDistortedFocalPlaneCoordinates(
11.0, -9.0,
0.0, 0.0,
1.0, 1.0,
0.0, 0.0,
iTransS, iTransL,
undistortedFocalPlaneX, undistortedFocalPlaneY);
EXPECT_NEAR(undistortedFocalPlaneX, -10.0, 1e-12);
EXPECT_NEAR(undistortedFocalPlaneY, 10.0, 1e-12);
}
TEST(UtilitiesTests, computeDistortedFocalPlaneCoordinatesStart) {
double iTransS[] = {0.0, 0.0, 10.0};
double iTransL[] = {0.0, 10.0, 0.0};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment