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
Julien Cabieces
otb
Commits
d405ccb9
Commit
d405ccb9
authored
4 years ago
by
Cédric Traizet
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add theshold and bv parameters to SpectralAngleClassification
parent
69ef64ed
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
Modules/Applications/AppHyperspectral/app/otbSpectralAngleClassification.cxx
+23
-4
23 additions, 4 deletions
...s/AppHyperspectral/app/otbSpectralAngleClassification.cxx
with
23 additions
and
4 deletions
Modules/Applications/AppHyperspectral/app/otbSpectralAngleClassification.cxx
+
23
−
4
View file @
d405ccb9
...
...
@@ -97,6 +97,20 @@ private:
AddChoice
(
"mode.sid"
,
"Spectral information divergence"
);
SetParameterDescription
(
"mode.sid"
,
"Spectral information divergence (SID) measure."
);
AddParameter
(
ParameterType_Float
,
"threshold"
,
"Classification threshold"
);
SetParameterDescription
(
"threshold"
,
"Pixel with a measurement greater than this threshold relatively to "
"a reference pixel are not classified. The same threshold is used for all classes."
);
MandatoryOff
(
"threshold"
);
AddParameter
(
ParameterType_Int
,
"bv"
,
"Background value"
);
SetParameterDescription
(
"bv"
,
"Value of unclassified pixels in the classification image "
"(this parameter is only used if threshold is set)."
);
MandatoryOff
(
"bv"
);
SetDefaultParameterInt
(
"bv"
,
-
1
);
AddRAMParameter
();
SetMultiWriting
(
true
);
...
...
@@ -158,11 +172,16 @@ private:
if
(
HasValue
(
"out"
))
{
// This lambda return the index of the minimum value in a pixel
auto
minIndexLambda
=
[](
PixelType
const
&
pixel
)
auto
threshold
=
HasValue
(
"threshold"
)
?
GetParameterFloat
(
"threshold"
)
:
std
::
numeric_limits
<
ValueType
>::
max
();
auto
bv
=
GetParameterInt
(
"bv"
);
// This lambda return the index of the minimum value in a pixel, values above threshold are not classified.
auto
minIndexLambda
=
[
threshold
,
bv
](
PixelType
const
&
pixel
)
{
auto
min
=
std
::
numeric_limits
<
ValueType
>::
max
();
unsigned
int
res
=
0
;
auto
min
=
threshold
;
int
res
=
bv
;
for
(
unsigned
int
i
=
0
;
i
<
pixel
.
Size
();
i
++
)
{
if
(
pixel
[
i
]
<
min
)
...
...
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