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
2811a18b
Commit
2811a18b
authored
9 years ago
by
Christophe Palmann
Browse files
Options
Downloads
Patches
Plain Diff
ENH: added GammaMAP and Kuan filters to the despeckling app + some tests (SAR)
parent
0485f321
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
Modules/Applications/AppFiltering/app/otbDespeckle.cxx
+59
-3
59 additions, 3 deletions
Modules/Applications/AppFiltering/app/otbDespeckle.cxx
Modules/Applications/AppFiltering/test/CMakeLists.txt
+44
-0
44 additions, 0 deletions
Modules/Applications/AppFiltering/test/CMakeLists.txt
with
103 additions
and
3 deletions
Modules/Applications/AppFiltering/app/otbDespeckle.cxx
+
59
−
3
View file @
2811a18b
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include
"otbFrostImageFilter.h"
#include
"otbFrostImageFilter.h"
#include
"otbLeeImageFilter.h"
#include
"otbLeeImageFilter.h"
#include
"otbGammaMAPImageFilter.h"
#include
"otbKuanImageFilter.h"
#include
"otbMultiToMonoChannelExtractROI.h"
#include
"otbMultiToMonoChannelExtractROI.h"
namespace
otb
namespace
otb
...
@@ -38,8 +40,10 @@ public:
...
@@ -38,8 +40,10 @@ public:
typedef
itk
::
ImageToImageFilter
<
FloatImageType
,
FloatImageType
>
SpeckleFilterType
;
typedef
itk
::
ImageToImageFilter
<
FloatImageType
,
FloatImageType
>
SpeckleFilterType
;
typedef
LeeImageFilter
<
FloatImageType
,
FloatImageType
>
LeeFilterType
;
typedef
LeeImageFilter
<
FloatImageType
,
FloatImageType
>
LeeFilterType
;
typedef
FrostImageFilter
<
FloatImageType
,
FloatImageType
>
FrostFilterType
;
typedef
FrostImageFilter
<
FloatImageType
,
FloatImageType
>
FrostFilterType
;
typedef
GammaMAPImageFilter
<
FloatImageType
,
FloatImageType
>
GammaMAPFilterType
;
typedef
KuanImageFilter
<
FloatImageType
,
FloatImageType
>
KuanFilterType
;
/** Standard macro */
/** Standard macro */
itkNewMacro
(
Self
);
itkNewMacro
(
Self
);
...
@@ -54,7 +58,7 @@ private:
...
@@ -54,7 +58,7 @@ private:
// Documentation
// Documentation
SetDocName
(
"Despeckle"
);
SetDocName
(
"Despeckle"
);
SetDocLongDescription
(
"This application reduce speckle noise.
Two
methods are available: Lee
and
Frost."
);
SetDocLongDescription
(
"This application reduce speckle noise.
Four
methods are available: Lee
,
Frost
, GammaMAP and Kuan
."
);
SetDocLimitations
(
"None"
);
SetDocLimitations
(
"None"
);
SetDocAuthors
(
"OTB-Team"
);
SetDocAuthors
(
"OTB-Team"
);
SetDocSeeAlso
(
" "
);
SetDocSeeAlso
(
" "
);
...
@@ -74,6 +78,10 @@ private:
...
@@ -74,6 +78,10 @@ private:
SetParameterDescription
(
"filter.lee"
,
"Lee filter"
);
SetParameterDescription
(
"filter.lee"
,
"Lee filter"
);
AddChoice
(
"filter.frost"
,
"Frost"
);
AddChoice
(
"filter.frost"
,
"Frost"
);
SetParameterDescription
(
"filter.frost"
,
"Frost filter"
);
SetParameterDescription
(
"filter.frost"
,
"Frost filter"
);
AddChoice
(
"filter.gammamap"
,
"GammaMap"
);
SetParameterDescription
(
"filter.gammamap"
,
"GammaMap filter"
);
AddChoice
(
"filter.kuan"
,
"Kuan"
);
SetParameterDescription
(
"filter.kuan"
,
"Kuan filter"
);
AddParameter
(
ParameterType_Int
,
"filter.lee.rad"
,
"Radius"
);
AddParameter
(
ParameterType_Int
,
"filter.lee.rad"
,
"Radius"
);
SetParameterDescription
(
"filter.lee.rad"
,
"Radius for lee filter"
);
SetParameterDescription
(
"filter.lee.rad"
,
"Radius for lee filter"
);
...
@@ -86,12 +94,26 @@ private:
...
@@ -86,12 +94,26 @@ private:
AddParameter
(
ParameterType_Float
,
"filter.frost.deramp"
,
"deramp"
);
AddParameter
(
ParameterType_Float
,
"filter.frost.deramp"
,
"deramp"
);
SetParameterDescription
(
"filter.frost.deramp"
,
"Decrease factor declaration"
);
SetParameterDescription
(
"filter.frost.deramp"
,
"Decrease factor declaration"
);
AddParameter
(
ParameterType_Int
,
"filter.gammamap.rad"
,
"Radius"
);
SetParameterDescription
(
"filter.gammamap.rad"
,
"Radius for GammaMAP filter"
);
AddParameter
(
ParameterType_Float
,
"filter.gammamap.nblooks"
,
"nb looks"
);
SetParameterDescription
(
"filter.gammamap.nblooks"
,
"Nb looks for GammaMAP filter"
);
AddParameter
(
ParameterType_Int
,
"filter.kuan.rad"
,
"Radius"
);
SetParameterDescription
(
"filter.kuan.rad"
,
"Radius for Kuan filter"
);
AddParameter
(
ParameterType_Float
,
"filter.kuan.nblooks"
,
"nb looks"
);
SetParameterDescription
(
"filter.kuan.nblooks"
,
"Nb looks for Kuan filter"
);
// Default values
// Default values
SetDefaultParameterInt
(
"filter.lee.rad"
,
1
);
SetDefaultParameterInt
(
"filter.lee.rad"
,
1
);
SetDefaultParameterFloat
(
"filter.lee.nblooks"
,
1.
);
SetDefaultParameterFloat
(
"filter.lee.nblooks"
,
1.
);
SetDefaultParameterInt
(
"filter.frost.rad"
,
1
);
SetDefaultParameterInt
(
"filter.frost.rad"
,
1
);
SetDefaultParameterFloat
(
"filter.frost.deramp"
,
0.1
);
SetDefaultParameterFloat
(
"filter.frost.deramp"
,
0.1
);
SetDefaultParameterInt
(
"filter.gammamap.rad"
,
1
);
SetDefaultParameterFloat
(
"filter.gammamap.nblooks"
,
1.
);
// Doc example parameter settings
// Doc example parameter settings
...
@@ -158,6 +180,40 @@ private:
...
@@ -158,6 +180,40 @@ private:
m_SpeckleFilter
=
filter
;
m_SpeckleFilter
=
filter
;
break
;
break
;
}
}
case
2
:
{
GammaMAPFilterType
::
Pointer
filter
=
GammaMAPFilterType
::
New
();
m_Ref
.
push_back
(
filter
.
GetPointer
());
filter
->
SetInput
(
inImage
);
GammaMAPFilterType
::
SizeType
lradius
;
lradius
.
Fill
(
GetParameterInt
(
"filter.gammamap.rad"
));
filter
->
SetRadius
(
lradius
);
filter
->
SetNbLooks
(
GetParameterFloat
(
"filter.gammamap.nblooks"
));
otbAppLogINFO
(
<<
"GammaMAP filter"
);
m_SpeckleFilter
=
filter
;
break
;
}
case
3
:
{
KuanFilterType
::
Pointer
filter
=
KuanFilterType
::
New
();
m_Ref
.
push_back
(
filter
.
GetPointer
());
filter
->
SetInput
(
inImage
);
KuanFilterType
::
SizeType
lradius
;
lradius
.
Fill
(
GetParameterInt
(
"filter.kuan.rad"
));
filter
->
SetRadius
(
lradius
);
filter
->
SetNbLooks
(
GetParameterFloat
(
"filter.kuan.nblooks"
));
otbAppLogINFO
(
<<
"Kuan filter"
);
m_SpeckleFilter
=
filter
;
break
;
}
default
:
default
:
{
{
otbAppLogFATAL
(
<<
"non defined speckle reduction filter "
<<
GetParameterInt
(
"filter"
)
<<
std
::
endl
);
otbAppLogFATAL
(
<<
"non defined speckle reduction filter "
<<
GetParameterInt
(
"filter"
)
<<
std
::
endl
);
...
...
This diff is collapsed.
Click to expand it.
Modules/Applications/AppFiltering/test/CMakeLists.txt
+
44
−
0
View file @
2811a18b
...
@@ -30,4 +30,48 @@ otb_test_application(NAME apTvUtSmoothingTest_OutXML
...
@@ -30,4 +30,48 @@ otb_test_application(NAME apTvUtSmoothingTest_OutXML
VALID --compare-image
${
NOTOL
}
VALID --compare-image
${
NOTOL
}
${
BASELINE
}
/apTvUtSmoothingTest.tif
${
BASELINE
}
/apTvUtSmoothingTest.tif
${
TEMP
}
/apTvUtSmoothingTest_OutXML.tif
)
${
TEMP
}
/apTvUtSmoothingTest_OutXML.tif
)
otb_test_application
(
NAME apTvDespeckleLee
APP Despeckle
OPTIONS -in
${
INPUTDATA
}
/GomaAvant.tif
-out
${
TEMP
}
/bfFiltreLee_05_05_12_app.tif
-filter lee
-filter.lee.rad 5
-filter.lee.nblooks 12
VALID --compare-image
${
EPSILON_7
}
${
BASELINE
}
/bfFiltreLee_05_05_12.tif
${
TEMP
}
/bfFiltreLee_05_05_12_app.tif
)
otb_test_application
(
NAME apTvDespeckleFrost
APP Despeckle
OPTIONS -in
${
INPUTDATA
}
/GomaAvant.tif
-out
${
TEMP
}
/bfFiltreFrost_05_05_12_app.tif
-filter frost
-filter.frost.rad 5
-filter.frost.deramp 0.1
VALID --compare-image
${
EPSILON_7
}
${
BASELINE
}
/bfFiltreLee_05_05_12.tif
${
TEMP
}
/bfFiltreLee_05_05_12_app.tif
)
otb_test_application
(
NAME apTvDespeckleGammaMAP
APP Despeckle
OPTIONS -in
${
INPUTDATA
}
/GomaAvant.tif
-out
${
TEMP
}
/bfFiltreGammaMAP_05_05_12_app.tif
-filter gammamap
-filter.gammamap.rad 5
-filter.gammamap.nblooks 12
VALID --compare-image
${
EPSILON_7
}
${
BASELINE
}
/bfFiltreGammaMAP_05_05_12.tif
${
TEMP
}
/bfFiltreGammaMAP_05_05_12_app.tif
)
otb_test_application
(
NAME apTvDespeckleKuan
APP Despeckle
OPTIONS -in
${
INPUTDATA
}
/GomaAvant.tif
-out
${
TEMP
}
/bfFiltreKuan_05_05_12_app.tif
-filter kuan
-filter.kuan.rad 5
-filter.kuan.nblooks 12
VALID --compare-image
${
EPSILON_7
}
${
BASELINE
}
/bfFiltreKuan_05_05_12.tif
${
TEMP
}
/bfFiltreKuan_05_05_12_app.tif
)
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