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
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
888eeedb
Commit
888eeedb
authored
14 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
ENH:compute toc in optical calibration application (for QB only for now) WPI
parent
0798a2ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Radiometry/otbOpticalCalibration.cxx
+49
-6
49 additions, 6 deletions
Radiometry/otbOpticalCalibration.cxx
with
49 additions
and
6 deletions
Radiometry/otbOpticalCalibration.cxx
+
49
−
6
View file @
888eeedb
...
...
@@ -61,16 +61,16 @@ int OpticalCalibration::Execute(otb::ApplicationOptionsResult* parseResult)
typedef
otb
::
MultiplyByScalarImageFilter
<
FloatImageType
,
ImageType
>
ScaleFilterType
;
typedef
ReflectanceToSurfaceReflectanceImageFilter
<
FloatImageType
,
FloatImageType
>
ReflectanceToSurfaceReflectanceImageFilterType
;
typedef
otb
::
PipelineMemoryPrintCalculator
MemoryCalculatorType
;
typedef
ReflectanceToSurfaceReflectanceImageFilterType
::
FilterFunctionValuesType
FilterFunctionValuesType
;
typedef
FilterFunctionValuesType
::
ValuesVectorType
ValuesVectorType
;
typedef
AtmosphericCorrectionParameters
AtmosphericCorrectionParametersType
;
typedef
AtmosphericCorrectionParametersType
::
AerosolModelType
AerosolModelType
;
typedef
otb
::
PipelineMemoryPrintCalculator
MemoryCalculatorType
;
// calibration process
if
(
parseResult
->
IsOptionPresent
(
"Level"
))
{
if
(
parseResult
->
GetParameterString
(
"Level"
)
==
"toc"
)
{
std
::
cerr
<<
"Not implemented yet"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
// Read input image information
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
...
...
@@ -88,6 +88,49 @@ int OpticalCalibration::Execute(otb::ApplicationOptionsResult* parseResult)
ScaleFilterType
::
Pointer
scaleFilter
=
ScaleFilterType
::
New
();
scaleFilter
->
SetInput
(
luminanceToReflectanceFilter
->
GetOutput
());
scaleFilter
->
SetCoef
(
1000.
);
if
(
parseResult
->
GetParameterString
(
"Level"
)
==
"toc"
)
{
//Declare the class to store atmospheric parameters default parameters for now
//TODO implement accessor to those parameters
//reflectanceToSurfaceReflectanceFilter->
AtmosphericCorrectionParametersType
::
Pointer
atmosphericParam
=
reflectanceToSurfaceReflectanceFilter
->
GetCorrectionParameters
();
AerosolModelType
aeroMod
=
AtmosphericCorrectionParametersType
::
NO_AEROSOL
;
atmosphericParam
->
SetAerosolModel
(
static_cast
<
AerosolModelType
>
(
aeroMod
));
atmosphericParam
->
SetOzoneAmount
(
0.
);
atmosphericParam
->
SetAtmosphericPressure
(
1030.
);
atmosphericParam
->
SetAerosolOptical
(
0.2
);
atmosphericParam
->
SetWaterVaporAmount
(
2.5
);
itk
::
MetaDataDictionary
dict
=
reader
->
GetOutput
()
->
GetMetaDataDictionary
();
OpticalImageMetadataInterface
::
Pointer
lImageMetadataInterface
=
OpticalImageMetadataInterfaceFactory
::
CreateIMI
(
dict
);
std
::
string
sensorID
=
lImageMetadataInterface
->
GetSensorID
();
if
(
sensorID
==
"QB02"
)
{
//Get the filter function values
for
(
unsigned
int
i
=
0
;
i
<
reader
->
GetOutput
()
->
GetNumberOfComponentsPerPixel
();
i
++
)
{
FilterFunctionValuesType
::
Pointer
functionValues
=
FilterFunctionValuesType
::
New
();
// functionValues->SetMinSpectralValue(imageMetadataInterface->GetFirstWavelengths()[i]);
// functionValues->SetMaxSpectralValue(imageMetadataInterface->GetLastWavelengths()[i]);
// functionValues->SetUserStep(0.0025);
// //functionValues->
atmosphericParam
->
SetWavelengthSpectralBandWithIndex
(
i
,
functionValues
);
}
reflectanceToSurfaceReflectanceFilter
->
SetFilterFunctionCoef
(
lImageMetadataInterface
->
GetSpectralSensitivity
());
}
reflectanceToSurfaceReflectanceFilter
->
SetIsSetAtmosphericRadiativeTerms
(
false
);
reflectanceToSurfaceReflectanceFilter
->
SetUseGenerateParameters
(
true
);
// bProgress->show();
// Fl::check();
reflectanceToSurfaceReflectanceFilter
->
GenerateParameters
();
}
//Instantiate the writer
WriterType
::
Pointer
writer
=
WriterType
::
New
();
...
...
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