Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Peillet
otb
Commits
adb3486f
Commit
adb3486f
authored
9 years ago
by
Christophe Palmann
Browse files
Options
Downloads
Patches
Plain Diff
ENH: added ossimRpcProjection type to otbSensorModelAdapter (and related test)
parent
90aa8afb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx
+42
-11
42 additions, 11 deletions
Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx
Modules/Applications/AppProjection/test/CMakeLists.txt
+14
-1
14 additions, 1 deletion
Modules/Applications/AppProjection/test/CMakeLists.txt
with
56 additions
and
12 deletions
Modules/Adapters/OSSIMAdapters/src/otbSensorModelAdapter.cxx
+
42
−
11
View file @
adb3486f
...
...
@@ -26,6 +26,7 @@
#include
"ossim/projection/ossimProjection.h"
#include
"ossim/projection/ossimSensorModelFactory.h"
#include
"ossim/projection/ossimSensorModel.h"
#include
"ossim/projection/ossimRpcProjection.h"
#include
"ossim/ossimPluginProjectionFactory.h"
#include
"ossim/base/ossimTieGptSet.h"
...
...
@@ -200,16 +201,30 @@ double SensorModelAdapter::Optimize()
if
(
m_SensorModel
!=
NULL
)
{
// try to retrieve a sensor model
ossimSensorModel
*
sensorModel
=
NULL
;
sensorModel
=
dynamic_cast
<
ossimSensorModel
*>
(
m_SensorModel
);
sensorModel
=
dynamic_cast
<
ossimSensorModel
*>
(
m_SensorModel
);
ossimRpcProjection
*
simpleRpcModel
=
NULL
;
simpleRpcModel
=
dynamic_cast
<
ossimRpcProjection
*>
(
m_SensorModel
);
//Handle expections
if
(
(
sensorModel
==
NULL
)
&&
(
simpleRpcModel
==
NULL
)
)
itkExceptionMacro
(
<<
"Optimize(): error, both dynamic_cast from ossimProjection* to ossimSensorModel* / ossimRpcProjection* failed."
);
if
(
sensorModel
!=
NULL
)
if
(
sensorModel
!=
NULL
)
{
// Call optimize fit
precision
=
sensorModel
->
optimizeFit
(
*
m_TiePoints
);
// Call optimize fit
precision
=
sensorModel
->
optimizeFit
(
*
m_TiePoints
);
}
else
itkExceptionMacro
(
<<
"Optimize(): error, dynamic_cast from ossimProjection* to ossimSensorModel* failed."
);
else
if
(
simpleRpcModel
!=
NULL
)
{
// Call optimize fit
precision
=
simpleRpcModel
->
optimizeFit
(
*
m_TiePoints
);
}
}
// Return the precision
...
...
@@ -241,15 +256,31 @@ bool SensorModelAdapter::WriteGeomFile(const std::string & outfile)
ossimSensorModel
*
sensorModel
=
NULL
;
sensorModel
=
dynamic_cast
<
ossimSensorModel
*>
(
m_SensorModel
);
if
(
sensorModel
==
NULL
)
itkExceptionMacro
(
<<
"WriteGeomFile(): error, dynamic_cast from ossimProjection* to ossimSensorModel* failed."
);
ossimRpcProjection
*
simpleRpcModel
=
NULL
;
simpleRpcModel
=
dynamic_cast
<
ossimRpcProjection
*>
(
m_SensorModel
);
//Handle expections
if
(
(
sensorModel
==
NULL
)
&&
(
simpleRpcModel
==
NULL
)
)
itkExceptionMacro
(
<<
"Optimize(): error, both dynamic_cast from ossimProjection* to ossimSensorModel* / ossimRpcProjection* failed."
);
ossimKeywordlist
geom
;
bool
success
=
sensorModel
->
saveState
(
geom
);
ossimKeywordlist
geom
;
bool
success
=
false
;
if
(
sensorModel
!=
NULL
)
{
// Save state
success
=
sensorModel
->
saveState
(
geom
);
}
else
if
(
simpleRpcModel
!=
NULL
)
{
// Save state
success
=
simpleRpcModel
->
saveState
(
geom
);
}
if
(
success
)
{
return
geom
.
write
(
outfile
.
c_str
());
return
geom
.
write
(
outfile
.
c_str
());
}
}
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Modules/Applications/AppProjection/test/CMakeLists.txt
+
14
−
1
View file @
adb3486f
...
...
@@ -253,7 +253,7 @@ otb_test_application(NAME apTvPrRefineSensorModel
APP RefineSensorModel
OPTIONS -ingeom
${
INPUTDATA
}
/QB_TOULOUSE_MUL_Extract_500_500.geom
-inpoints
${
INPUTDATA
}
/QB_TOULOUSE_MUL_Extract_500_500_in_tie_points.txt
-outgeom
${
TEMP
}
/apTvPrRefineSensorModelGeomOutput.geom
-outgeom
${
TEMP
}
/apTvPrRefineSensorModelGeomOutput.geom
-outstat
${
TEMP
}
/apTvPrRefineSensorModelStatsOutput.txt
-outvector
${
TEMP
}
/apTvPrRefineSensorModelVectorOutput.shp
-map utm -map.utm.zone 31 -map.utm.northhem 1
...
...
@@ -263,6 +263,17 @@ otb_test_application(NAME apTvPrRefineSensorModel
${
BASELINE_FILES
}
/apTvPrRefineSensorModelGeomOutput.geom
${
TEMP
}
/apTvPrRefineSensorModelGeomOutput.geom
)
otb_test_application
(
NAME apTvPrRefineSensorModel2
APP RefineSensorModel
OPTIONS -ingeom
${
INPUTDATA
}
/s1a-iw-grd-vh-20150210t060009-20150210t060034-004557-0059a3-002.geom
-inpoints
${
INPUTDATA
}
/pts_idV5.txt
-outgeom
${
TEMP
}
/apTvPrRefineSensorModelGeomOutput2.geom
VALID --compare-ascii 0.1
${
BASELINE_FILES
}
/apTvPrRefineSensorModelGeomOutput2.geom
${
TEMP
}
/apTvPrRefineSensorModelGeomOutput2.geom
)
#----------- RigidTransformResample TESTS ----------------
otb_test_application
(
NAME apTvPrRigidTransformResample
...
...
@@ -276,6 +287,8 @@ otb_test_application(NAME apTvPrRigidTransformResample
VALID --compare-image
${
NOTOL
}
${
BASELINE
}
/owTvRigidTransformResampleTest.tif
${
TEMP
}
/apTvPrRigidTransformResampleTest.tif
)
#----------- ImageEnvelope TESTS ----------------
...
...
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