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
ef2ff5d0
Commit
ef2ff5d0
authored
May 3, 2022
by
Jesse Mapel
Committed by
Jesse Mapel
May 4, 2022
Browse files
Options
Downloads
Patches
Plain Diff
Updated push frame to use secant frame search
parent
1c4832d8
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
include/usgscsm/UsgsAstroPushFrameSensorModel.h
+6
-0
6 additions, 0 deletions
include/usgscsm/UsgsAstroPushFrameSensorModel.h
src/UsgsAstroPushFrameSensorModel.cpp
+39
-18
39 additions, 18 deletions
src/UsgsAstroPushFrameSensorModel.cpp
with
45 additions
and
18 deletions
include/usgscsm/UsgsAstroPushFrameSensorModel.h
+
6
−
0
View file @
ef2ff5d0
...
...
@@ -945,6 +945,12 @@ class UsgsAstroPushFrameSensorModel : public csm::RasterGM,
const
csm
::
EcefCoord
&
groundPt
,
const
std
::
vector
<
double
>&
adj
)
const
;
// Computes the line distance from the center of a frame to the image point
// that a ground point reprojects to at that frame.
double
calcFrameDistance
(
int
frameletNumber
,
const
csm
::
EcefCoord
&
groundPt
,
const
std
::
vector
<
double
>&
adj
)
const
;
csm
::
NoCorrelationModel
_no_corr_model
;
// A way to report no correlation
// between images is supported
std
::
vector
<
double
>
...
...
This diff is collapsed.
Click to expand it.
src/UsgsAstroPushFrameSensorModel.cpp
+
39
−
18
View file @
ef2ff5d0
...
...
@@ -667,30 +667,24 @@ csm::ImageCoord UsgsAstroPushFrameSensorModel::groundToImage(
double
desiredPrecision
,
double
*
achievedPrecision
,
csm
::
WarningList
*
warnings
)
const
{
//
Binary
search for the
framelet that is closest to the given ground poin
t.
//
Secant
search for the
where the ground point is closest to the middle of the framele
t.
int
summedFrameletHeight
=
m_frameletHeight
/
m_detectorLineSumming
;
int
startFramelet
=
0
;
double
startDistance
=
calc
Sensor
Distance
(
startFramelet
,
groundPt
,
adj
);
double
startDistance
=
calc
Frame
Distance
(
startFramelet
,
groundPt
,
adj
);
int
endFramelet
=
m_nLines
/
summedFrameletHeight
-
1
;
double
endDistance
=
calc
Sensor
Distance
(
endFramelet
,
groundPt
,
adj
);
int
maxIts
=
20
;
// Caps out at ~1 million framelets
double
endDistance
=
calc
Frame
Distance
(
endFramelet
,
groundPt
,
adj
);
int
maxIts
=
20
;
int
count
=
0
;
while
(
startFramelet
!=
endFramelet
&&
count
<
maxIts
)
{
int
middleFramelet
=
(
endFramelet
+
startFramelet
)
/
2
;
double
middleDistance
=
calcSensorDistance
(
middleFramelet
,
groundPt
,
adj
);
if
(
endDistance
<
startDistance
)
{
startFramelet
=
middleFramelet
;
startDistance
=
middleDistance
;
}
else
{
endFramelet
=
middleFramelet
;
endDistance
=
middleDistance
;
}
count
++
;
while
(
startFramelet
!=
endFramelet
&&
startDistance
!=
endDistance
&&
count
++
<
maxIts
)
{
double
offset
=
endDistance
*
(
endFramelet
-
startFramelet
)
/
(
endDistance
-
startDistance
);
startFramelet
=
endFramelet
;
startDistance
=
endDistance
;
endFramelet
=
std
::
round
(
endFramelet
-
offset
);
endDistance
=
calcFrameDistance
(
endFramelet
,
groundPt
,
adj
);
}
// Get the focal plane coordinate at that framelet
double
time
=
getImageTime
(
csm
::
ImageCoord
(
0.5
+
summedFrameletHeight
*
start
Framelet
,
0.0
));
double
time
=
getImageTime
(
csm
::
ImageCoord
(
0.5
+
summedFrameletHeight
*
end
Framelet
,
0.0
));
std
::
vector
<
double
>
focalCoord
=
computeDetectorView
(
time
,
groundPt
,
adj
);
// Invert distortion
...
...
@@ -707,7 +701,7 @@ csm::ImageCoord UsgsAstroPushFrameSensorModel::groundToImage(
// Convert to image sample line
csm
::
ImageCoord
imagePt
;
imagePt
.
line
=
start
Framelet
*
summedFrameletHeight
;
imagePt
.
line
=
end
Framelet
*
summedFrameletHeight
;
imagePt
.
line
+=
(
detectorLine
+
m_detectorLineOrigin
-
m_startingDetectorLine
)
/
m_detectorLineSumming
;
imagePt
.
samp
=
(
detectorSample
+
m_detectorSampleOrigin
-
m_startingDetectorSample
)
...
...
@@ -717,6 +711,10 @@ csm::ImageCoord UsgsAstroPushFrameSensorModel::groundToImage(
*
achievedPrecision
=
desiredPrecision
;
}
MESSAGE_LOG
(
"Found image point {} {}"
,
imagePt
.
line
,
imagePt
.
samp
);
return
imagePt
;
}
...
...
@@ -2454,3 +2452,26 @@ double UsgsAstroPushFrameSensorModel::calcSensorDistance(int frameletNumber,
return
dist
;
}
double
UsgsAstroPushFrameSensorModel
::
calcFrameDistance
(
int
frameletNumber
,
const
csm
::
EcefCoord
&
groundPt
,
const
std
::
vector
<
double
>&
adj
)
const
{
MESSAGE_LOG
(
"Calculating frame distance for frame {} and ground point {}, {}, {}"
,
frameletNumber
,
groundPt
.
x
,
groundPt
.
y
,
groundPt
.
z
)
int
summedFrameletHeight
=
m_frameletHeight
/
m_detectorLineSumming
;
csm
::
ImageCoord
centerFramePt
((
frameletNumber
+
0.5
)
*
summedFrameletHeight
,
m_nSamples
/
2.0
);
double
frameTime
=
getImageTime
(
centerFramePt
);
std
::
vector
<
double
>
detectorView
=
computeDetectorView
(
frameTime
,
groundPt
,
adj
);
// Convert to detector line
double
detectorLine
=
m_iTransL
[
0
]
+
m_iTransL
[
1
]
*
detectorView
[
0
]
+
m_iTransL
[
2
]
*
detectorView
[
1
]
+
m_detectorLineOrigin
-
m_startingDetectorLine
;
detectorLine
/=
m_detectorLineSumming
;
// Return distance to center of frame
MESSAGE_LOG
(
"Frame distance of {} lines"
,
detectorLine
-
summedFrameletHeight
/
2.0
)
return
detectorLine
-
summedFrameletHeight
/
2.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
sign in
to comment