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
Antoine Belvire
otb
Commits
7cc61bc7
Commit
7cc61bc7
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: automatic retrieval of radiometric parameters from ossim metadata
parent
db51e502
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
Code/Radiometry/otbImageToReflectanceImageFilter.h
+54
-8
54 additions, 8 deletions
Code/Radiometry/otbImageToReflectanceImageFilter.h
Code/Radiometry/otbLuminanceToReflectanceImageFilter.h
+5
-1
5 additions, 1 deletion
Code/Radiometry/otbLuminanceToReflectanceImageFilter.h
with
59 additions
and
9 deletions
Code/Radiometry/otbImageToReflectanceImageFilter.h
+
54
−
8
View file @
7cc61bc7
...
...
@@ -203,22 +203,68 @@ public:
protected
:
ImageToReflectanceImageFilter
()
{
m_Alpha
.
SetSize
(
1
);
m_Alpha
.
Fill
(
0
);
m_Beta
.
SetSize
(
1
);
m_Beta
.
Fill
(
0
);
m_ZenithalSolarAngle
=
1.
;
m_Alpha
.
SetSize
(
0
);
m_Beta
.
SetSize
(
0
);
m_ZenithalSolarAngle
=
120.
;
//invalid value which will lead to negative radiometry
m_FluxNormalizationCoefficient
=
1.
;
m_SolarIllumination
.
Fill
(
1.
);
m_SolarIllumination
.
SetSize
(
0
);
m_IsSetFluxNormalizationCoefficient
=
false
;
m_Day
=
1
;
m_Month
=
1
;
m_Day
=
-
1
;
m_Month
=
-
1
;
};
virtual
~
ImageToReflectanceImageFilter
()
{};
virtual
void
BeforeThreadedGenerateData
(
void
)
{
ImageMetadataInterface
::
Pointer
imageMetadataInterface
=
ImageMetadataInterface
::
New
();
if
(
m_Alpha
.
GetSize
()
==
0
)
{
m_Alpha
=
imageMetadataInterface
->
GetPhysicalGain
(
this
->
GetInput
()
->
GetMetaDataDictionary
());
}
if
(
m_Beta
.
GetSize
()
==
0
)
{
m_Beta
=
imageMetadataInterface
->
GetPhysicalBias
(
this
->
GetInput
()
->
GetMetaDataDictionary
());
}
if
(
m_Day
==
-
1
)
{
m_Day
=
imageMetadataInterface
->
GetDay
(
this
->
GetInput
()
->
GetMetaDataDictionary
());
}
if
(
m_Month
==
-
1
)
{
m_Month
=
imageMetadataInterface
->
GetMonth
(
this
->
GetInput
()
->
GetMetaDataDictionary
());
}
if
(
m_SolarIllumination
.
GetSize
()
==
0
)
{
m_SolarIllumination
=
imageMetadataInterface
->
GetSolarIrradiance
(
this
->
GetInput
()
->
GetMetaDataDictionary
());
}
if
(
m_ZenithalSolarAngle
==
120.0
)
{
//the zenithal angle is the complementary of the elevation angle
m_ZenithalSolarAngle
=
90.0
-
imageMetadataInterface
->
GetSunElevation
(
this
->
GetInput
()
->
GetMetaDataDictionary
());
}
otbMsgDevMacro
(
<<
"Using correction parameters: "
);
otbMsgDevMacro
(
<<
"Alpha (gain): "
<<
m_Alpha
);
otbMsgDevMacro
(
<<
"Beta (bias): "
<<
m_Beta
);
otbMsgDevMacro
(
<<
"Day: "
<<
m_Day
);
otbMsgDevMacro
(
<<
"Month: "
<<
m_Month
);
otbMsgDevMacro
(
<<
"Solar irradiance: "
<<
m_SolarIllumination
);
otbMsgDevMacro
(
<<
"Zenithal angle: "
<<
m_ZenithalSolarAngle
);
if
((
m_Alpha
.
GetSize
()
!=
this
->
GetInput
()
->
GetNumberOfComponentsPerPixel
())
||
(
m_Beta
.
GetSize
()
!=
this
->
GetInput
()
->
GetNumberOfComponentsPerPixel
())
||
(
m_SolarIllumination
.
GetSize
()
!=
this
->
GetInput
()
->
GetNumberOfComponentsPerPixel
()))
{
itkExceptionMacro
(
<<
"Alpha, Beta and SolarIllumination parameters should have the same size as the number of bands"
);
}
this
->
GetFunctorVector
().
clear
();
for
(
unsigned
int
i
=
0
;
i
<
this
->
GetInput
()
->
GetNumberOfComponentsPerPixel
();
++
i
)
{
...
...
This diff is collapsed.
Click to expand it.
Code/Radiometry/otbLuminanceToReflectanceImageFilter.h
+
5
−
1
View file @
7cc61bc7
...
...
@@ -184,7 +184,6 @@ protected:
m_ZenithalSolarAngle
=
120.0
;
//invalid value which will lead to negative radiometry
m_FluxNormalizationCoefficient
=
1.
;
m_SolarIllumination
.
SetSize
(
0
);
// m_SolarIllumination.Fill(1.);
m_Month
=
-
1
;
m_Day
=
-
1
;
m_IsSetFluxNormalizationCoefficient
=
false
;
...
...
@@ -223,6 +222,11 @@ protected:
otbMsgDevMacro
(
<<
"Solar irradiance: "
<<
m_SolarIllumination
);
otbMsgDevMacro
(
<<
"Zenithal angle: "
<<
m_ZenithalSolarAngle
);
if
((
m_SolarIllumination
.
GetSize
()
!=
this
->
GetInput
()
->
GetNumberOfComponentsPerPixel
()))
{
itkExceptionMacro
(
<<
"SolarIllumination parameter should have the same size as the number of bands"
);
}
this
->
GetFunctorVector
().
clear
();
for
(
unsigned
int
i
=
0
;
i
<
this
->
GetInput
()
->
GetNumberOfComponentsPerPixel
();
++
i
)
...
...
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