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
26a2d787
Commit
26a2d787
authored
12 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
ENH: simplify computation of Frost despeckle coefficients
parent
80a212de
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/BasicFilters/otbFrostImageFilter.txx
+11
-11
11 additions, 11 deletions
Code/BasicFilters/otbFrostImageFilter.txx
with
11 additions
and
11 deletions
Code/BasicFilters/otbFrostImageFilter.txx
+
11
−
11
View file @
26a2d787
...
...
@@ -163,22 +163,22 @@ void FrostImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(
NormFilter = 0.0;
FrostFilter = 0.0;
const
double
rad_x =
static_cast<double>(
m_Radius[0]
)
;
const
double
rad_y =
static_cast<double>(
m_Radius[1]
)
;
const
int
rad_x = m_Radius[0];
const
int
rad_y = m_Radius[1];
for (
double
x = -rad_x; x <= rad_x; ++x)
for (
int
x = -rad_x; x <= rad_x; ++x)
{
for (
double
y = -rad_y; y <= rad_y; ++y)
for (
int
y = -rad_y; y <= rad_y; ++y)
{
double Dist =
double(
vcl_sqrt(x * x + y * y)
)
;
off[0] =
static_cast<int>(x)
;
off[1] =
static_cast<int>(y)
;
// i = (unsigned int)((y+rad_y)*(2*rad_y+1)+(x+rad_x));
double Dist = vcl_sqrt(x * x + y * y);
off[0] =
x
;
off[1] =
y
;
dPixel = static_cast<double>(bit.GetPixel(off));
// dPixel= static_cast<double>( bit.GetPixel(i));
CoefFilter = Alpha * vcl_exp(-Alpha * Dist);
NormFilter
= NormFilter
+ CoefFilter;
FrostFilter
= FrostFilter
+ (CoefFilter * dPixel);
NormFilter +
=
CoefFilter;
FrostFilter +
=
(CoefFilter * dPixel);
}
}
...
...
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