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
940ed00f
Commit
940ed00f
authored
9 years ago
by
Julien Michel
Browse files
Options
Downloads
Plain Diff
Merge branch 'patch-meanshift-smoothing' into develop
parents
1de2379d
7d44e775
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.txx
+7
-5
7 additions, 5 deletions
...ng/Smoothing/include/otbMeanShiftSmoothingImageFilter.txx
with
7 additions
and
5 deletions
Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.txx
+
7
−
5
View file @
940ed00f
...
...
@@ -375,7 +375,7 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt
neighborhoodRegion.SetSize(regionSize);
RealType weightSum = 0;
RealVector
jointNeighbor(ImageDimension + m_NumberOfComponentsPerPixel), shifts(ImageDimension + m_NumberOfComponentsPerPixel
);
RealVector
shifts(jointDimension
);
// An iterator on the neighborhood of the current pixel (in joint
// spatial-range domain)
...
...
@@ -385,7 +385,7 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt
it.GoToBegin();
while (!it.IsAtEnd())
{
jointNeighbor = it.Get();
const RealType *
jointNeighbor = it.Get
PixelPointer
();
// Compute the squared norm of the difference
// This is the L2 norm, TODO: replace by the templated norm
...
...
@@ -393,7 +393,7 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt
for (unsigned int comp = 0; comp < jointDimension; comp++)
{
shifts[comp] = jointNeighbor[comp] - jointPixel[comp];
double d = shifts[comp]
/
bandwidth[comp];
double d = shifts[comp]
/
bandwidth[comp];
norm2 += d*d;
}
...
...
@@ -554,7 +554,7 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt
typename OutputImageType::PixelType rangePixel(m_NumberOfComponentsPerPixel);
typename OutputSpatialImageType::PixelType spatialPixel(ImageDimension);
RealVector jointPixel;
RealVector jointPixel
(jointDimension)
;
RealVector bandwidth(jointDimension);
for (unsigned int comp = 0; comp < ImageDimension; comp++)
...
...
@@ -612,7 +612,9 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt
// get input pixel in the joint spatial-range domain (with components
// normalized by bandwith)
jointPixel = jointIt.Get(); // Pixel in the joint spatial-range domain
const RealVector &jointPixelVal = jointIt.Get(); // Pixel in the joint spatial-range domain
for (unsigned int comp = 0; comp < jointDimension; comp++)
jointPixel[comp] = jointPixelVal[comp];
for (unsigned int comp = ImageDimension; comp < jointDimension; comp++)
bandwidth[comp] = m_RangeBandwidthRamp*jointPixel[comp]+m_RangeBandwidth;
...
...
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