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
07b601e9
Commit
07b601e9
authored
5 years ago
by
Cédric Traizet
Browse files
Options
Downloads
Patches
Plain Diff
ENH: added parameters for maximum error and maximum kernel width in Smoothing
parent
89ab63f2
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/AppFiltering/app/otbSmoothing.cxx
+14
-1
14 additions, 1 deletion
Modules/Applications/AppFiltering/app/otbSmoothing.cxx
with
14 additions
and
1 deletion
Modules/Applications/AppFiltering/app/otbSmoothing.cxx
+
14
−
1
View file @
07b601e9
...
...
@@ -90,8 +90,17 @@ private:
SetParameterDescription
(
"type.gaussian.stdev"
,
"Standard deviation of the gaussian kernel used to filter the image"
);
SetDefaultParameterFloat
(
"type.gaussian.stdev"
,
2.0
);
AddChoice
(
"type.anidif"
,
"Anisotropic Diffusion"
);
AddParameter
(
ParameterType_Float
,
"type.gaussian.maxerror"
,
"Maximum error"
);
SetParameterDescription
(
"type.gaussian.stdev"
,
"The algorithm will size the discrete kernel so that the error "
"resulting from truncation of the kernel is no greater than maxerror."
);
SetDefaultParameterFloat
(
"type.gaussian.maxerror"
,
0.01
);
AddParameter
(
ParameterType_Int
,
"type.gaussian.maxwidth"
,
"Maximum kernel width"
);
SetParameterDescription
(
"type.gaussian.maxwidth"
,
"Set the kernel to be no wider than maxwidth pixels, "
"even if type.gaussian.maxerror demands it."
);
SetDefaultParameterInt
(
"type.gaussian.maxwidth"
,
32
);
AddChoice
(
"type.anidif"
,
"Anisotropic Diffusion"
);
AddParameter
(
ParameterType_Float
,
"type.anidif.timestep"
,
"Time Step"
);
SetParameterDescription
(
"type.anidif.timestep"
,
"Time step that will be used to discretize the diffusion equation"
);
...
...
@@ -175,8 +184,12 @@ private:
const
double
stdev
=
GetParameterFloat
(
"type.gaussian.stdev"
);
double
variance
=
stdev
*
stdev
;
perBand
->
GetFilter
()
->
SetVariance
(
variance
);
perBand
->
GetFilter
()
->
SetUseImageSpacing
(
false
);
perBand
->
GetFilter
()
->
SetMaximumError
(
GetParameterFloat
(
"type.gaussian.maxerror"
));
perBand
->
GetFilter
()
->
SetMaximumKernelWidth
(
GetParameterInt
(
"type.gaussian.maxwidth"
));
perBand
->
UpdateOutputInformation
();
m_FilterRef
=
perBand
;
SetParameterOutputImage
(
"out"
,
perBand
->
GetOutput
());
...
...
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