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
88ca95e9
Commit
88ca95e9
authored
12 years ago
by
Sebastien Harasse
Browse files
Options
Downloads
Patches
Plain Diff
BUG: mean shift. fixed wrong allocation code
parent
f9845c8f
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
Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx
+13
-7
13 additions, 7 deletions
Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx
with
13 additions
and
7 deletions
Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx
+
13
−
7
View file @
88ca95e9
...
...
@@ -237,6 +237,8 @@ MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIterati
OutputSpatialImagePointerType outSpatialPtr = this->GetSpatialOutput();
OutputImagePointerType outRangePtr = this->GetRangeOutput();
typename InputImageType::ConstPointer inputPtr = this->GetInput();
typename OutputIterationImageType::Pointer iterationOutput = this->GetIterationOutput();
typename OutputSpatialImageType::Pointer spatialOutput = this->GetSpatialOutput();
//InputIndexType index;
...
...
@@ -246,6 +248,17 @@ MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIterati
m_NumberOfComponentsPerPixel = this->GetInput()->GetNumberOfComponentsPerPixel();
// Allocate output images
this->AllocateOutputs();
// Initialize output images to zero
iterationOutput->FillBuffer(0);
OutputSpatialPixelType zero(spatialOutput->GetNumberOfComponentsPerPixel());
zero.Fill(0);
spatialOutput->FillBuffer(zero);
// m_JointImage is the input data expressed in the joint spatial-range
// domain, i.e. spatial coordinates are concatenated to the range values.
// Moreover, pixel components in this image are normalized by their respective
...
...
@@ -537,8 +550,6 @@ MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIterati
{
// at the first iteration
// Allocate output images
this->AllocateOutputs();
// Retrieve output images pointers
typename OutputSpatialImageType::Pointer spatialOutput = this->GetSpatialOutput();
...
...
@@ -563,11 +574,6 @@ MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIterati
RealVector jointPixel;
// Initialize output images to zero
iterationOutput->FillBuffer(0);
OutputSpatialPixelType zero(spatialOutput->GetNumberOfComponentsPerPixel());
zero.Fill(0);
spatialOutput->FillBuffer(zero);
RealVector bandwidth(jointDimension);
for (unsigned int comp = 0; comp < ImageDimension; comp++) bandwidth[comp] = m_SpatialBandwidth;
...
...
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