Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Usgscsm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Usgscsm
Commits
19d6be9f
Commit
19d6be9f
authored
5 years ago
by
Austin Sanders
Browse files
Options
Downloads
Patches
Plain Diff
Fixed matrix inversion in computeDistortedFocalPlaneCoordinates
parent
363546b7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Utilities.cpp
+7
-2
7 additions, 2 deletions
src/Utilities.cpp
tests/UtilitiesTests.cpp
+16
-0
16 additions, 0 deletions
tests/UtilitiesTests.cpp
with
23 additions
and
2 deletions
src/Utilities.cpp
+
7
−
2
View file @
19d6be9f
...
@@ -87,13 +87,18 @@ void computeDistortedFocalPlaneCoordinates(
...
@@ -87,13 +87,18 @@ void computeDistortedFocalPlaneCoordinates(
double
t1
=
detLine
-
lineOrigin
-
iTransL
[
0
];
double
t1
=
detLine
-
lineOrigin
-
iTransL
[
0
];
double
t2
=
detSample
-
sampleOrigin
-
iTransS
[
0
];
double
t2
=
detSample
-
sampleOrigin
-
iTransS
[
0
];
double
determinant
=
m11
*
m22
-
m12
*
m21
;
double
determinant
=
m11
*
m22
-
m12
*
m21
;
double
p11
=
m
11
/
determinant
;
double
p11
=
m
22
/
determinant
;
double
p12
=
-
m12
/
determinant
;
double
p12
=
-
m12
/
determinant
;
double
p21
=
-
m21
/
determinant
;
double
p21
=
-
m21
/
determinant
;
double
p22
=
m
22
/
determinant
;
double
p22
=
m
11
/
determinant
;
distortedX
=
p11
*
t1
+
p12
*
t2
;
distortedX
=
p11
*
t1
+
p12
*
t2
;
distortedY
=
p21
*
t1
+
p22
*
t2
;
distortedY
=
p21
*
t1
+
p22
*
t2
;
std
::
cout
<<
t1
<<
", "
<<
t2
<<
std
::
endl
;
std
::
cout
<<
p11
<<
", "
<<
p12
<<
std
::
endl
;
std
::
cout
<<
p21
<<
", "
<<
p22
<<
std
::
endl
;
};
};
// Compue the image pixel for a distorted focal plane coordinate
// Compue the image pixel for a distorted focal plane coordinate
...
...
This diff is collapsed.
Click to expand it.
tests/UtilitiesTests.cpp
+
16
−
0
View file @
19d6be9f
...
@@ -81,6 +81,22 @@ TEST(UtilitiesTests, computeDistortedFocalPlaneCoordinatesSumming) {
...
@@ -81,6 +81,22 @@ TEST(UtilitiesTests, computeDistortedFocalPlaneCoordinatesSumming) {
EXPECT_DOUBLE_EQ
(
undistortedFocalPlaneY
,
0
);
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
)
{
TEST
(
UtilitiesTests
,
computeDistortedFocalPlaneCoordinatesStart
)
{
double
iTransS
[]
=
{
0.0
,
0.0
,
10.0
};
double
iTransS
[]
=
{
0.0
,
0.0
,
10.0
};
double
iTransL
[]
=
{
0.0
,
10.0
,
0.0
};
double
iTransL
[]
=
{
0.0
,
10.0
,
0.0
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment