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
85f333c2
Commit
85f333c2
authored
12 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add optional clamp on output reflectivity
parent
e3640797
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Radiometry/otbLuminanceToReflectanceImageFilter.h
+27
-3
27 additions, 3 deletions
Code/Radiometry/otbLuminanceToReflectanceImageFilter.h
with
27 additions
and
3 deletions
Code/Radiometry/otbLuminanceToReflectanceImageFilter.h
+
27
−
3
View file @
85f333c2
...
...
@@ -57,7 +57,8 @@ class LuminanceToReflectanceImageFunctor
public:
LuminanceToReflectanceImageFunctor
()
:
m_SolarIllumination
(
1.0
),
m_IlluminationCorrectionCoefficient
(
1.0
)
m_IlluminationCorrectionCoefficient
(
1.0
),
m_UseClamp
(
false
)
{}
virtual
~
LuminanceToReflectanceImageFunctor
()
{}
...
...
@@ -70,6 +71,10 @@ public:
{
m_IlluminationCorrectionCoefficient
=
coef
;
}
void
SetUseClamp
(
bool
useClamp
)
{
m_UseClamp
=
useClamp
;
}
double
GetSolarIllumination
()
{
...
...
@@ -79,6 +84,10 @@ public:
{
return
m_IlluminationCorrectionCoefficient
;
}
bool
GetUseClamp
()
{
return
m_UseClamp
;
}
inline
TOutput
operator
()(
const
TInput
&
inPixel
)
const
{
...
...
@@ -88,7 +97,12 @@ public:
*
static_cast
<
double
>
(
CONST_PI
)
*
m_IlluminationCorrectionCoefficient
/
m_SolarIllumination
;
if
(
m_UseClamp
)
{
temp
=
std
::
max
(
temp
,
0.0
);
temp
=
std
::
min
(
temp
,
1.0
);
}
outPixel
=
static_cast
<
TOutput
>
(
temp
);
return
outPixel
;
...
...
@@ -97,6 +111,7 @@ public:
private
:
double
m_SolarIllumination
;
double
m_IlluminationCorrectionCoefficient
;
double
m_UseClamp
;
};
}
...
...
@@ -214,6 +229,11 @@ public:
/** Give the IsSetFluxNormalizationCoefficient boolean. */
itkGetConstReferenceMacro
(
IsSetFluxNormalizationCoefficient
,
bool
);
/** Set the UseClamp boolean. */
itkSetMacro
(
UseClamp
,
bool
);
/** Give the UseClamp boolean. */
itkGetConstReferenceMacro
(
UseClamp
,
bool
);
protected
:
/** Constructor */
LuminanceToReflectanceImageFilter
()
:
...
...
@@ -221,7 +241,8 @@ protected:
m_FluxNormalizationCoefficient
(
1.
),
m_Day
(
0
),
m_Month
(
0
),
m_IsSetFluxNormalizationCoefficient
(
false
)
m_IsSetFluxNormalizationCoefficient
(
false
),
m_UseClamp
(
false
)
{
m_SolarIllumination
.
SetSize
(
0
);
};
...
...
@@ -296,6 +317,7 @@ protected:
}
functor
.
SetIlluminationCorrectionCoefficient
(
1.
/
coefTemp
);
functor
.
SetSolarIllumination
(
static_cast
<
double
>
(
m_SolarIllumination
[
i
]));
functor
.
SetUseClamp
(
m_UseClamp
);
this
->
GetFunctorVector
().
push_back
(
functor
);
}
...
...
@@ -316,6 +338,8 @@ private:
/** Used to know if the user has set a value for the FluxNormalizationCoefficient parameter
* or if the class has to compute it */
bool
m_IsSetFluxNormalizationCoefficient
;
/** Clamp values to [0,1] */
bool
m_UseClamp
;
};
...
...
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