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
7d568715
Commit
7d568715
authored
8 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: indentation and long lines
parent
df670fe6
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
Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx
+13
-17
13 additions, 17 deletions
...ting/include/otbNeighborhoodMajorityVotingImageFilter.txx
with
13 additions
and
17 deletions
Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx
+
13
−
17
View file @
7d568715
...
...
@@ -45,16 +45,16 @@ NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage, TKernel>::Neigh
template<class TInputImage, class TOutputImage, class TKernel>
typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
TKernel>::PixelType NeighborhoodMajorityVotingImageFilter<TInputImage,
TOutputImage, TKernel>::Evaluate(const NeighborhoodIteratorType &nit,
const KernelIteratorType kernelBegin,
const KernelIteratorType kernelEnd)
TKernel>::PixelType
NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
TKernel>::Evaluate(const NeighborhoodIteratorType &nit,
const KernelIteratorType kernelBegin,
const KernelIteratorType kernelEnd)
{
const PixelType centerPixel = nit.GetCenterPixel();
if (centerPixel != m_LabelForNoDataPixels)
{
//Get a histogram of label frequencies where the 2 highest are at the beginning and sorted
//Get a histogram of label frequencies where the 2 highest are at the beginning and sorted
const HistoSummary histoSummary = this->FillNeighborhoodHistogram(nit, kernelBegin, kernelEnd);
if(m_OnlyIsolatedPixels && histoSummary.freqCenterLabel > m_IsolatedThreshold)
...
...
@@ -67,7 +67,8 @@ typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
else
{
//If the majorityLabel is NOT unique in the neighborhood
if(histoSummary.secondFreq == histoSummary.majorityFreq && histoSummary.secondLabel != histoSummary.majorityLabel)
if(histoSummary.secondFreq == histoSummary.majorityFreq &&
histoSummary.secondLabel != histoSummary.majorityLabel)
{
if (m_KeepOriginalLabelBool == true)
{
...
...
@@ -78,12 +79,8 @@ typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
return m_LabelForUndecidedPixels;
}
}
}
}//END if (centerPixel != m_LabelForNoDataPixels)
//If (centerPixel == m_LabelForNoDataPixels)
else
{
...
...
@@ -95,11 +92,11 @@ typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
template<class TInputImage, class TOutputImage, class TKernel>
const typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
TKernel>::HistoSummary
NeighborhoodMajorityVotingImageFilter<TInputImage,
TOutputImage,
TKernel>::FillNeighborhoodHistogram(const NeighborhoodIteratorType &nit,
const KernelIteratorType kernelBegin,
const KernelIteratorType kernelEnd) const
TKernel>::HistoSummary
NeighborhoodMajorityVotingImageFilter<TInputImage,
TOutputImage,
TKernel>::FillNeighborhoodHistogram(const NeighborhoodIteratorType &nit,
const KernelIteratorType kernelBegin,
const KernelIteratorType kernelEnd) const
{
std::map<PixelType, unsigned int> histoNeigh;
PixelType centerPixel = nit.GetCenterPixel();
...
...
@@ -118,7 +115,6 @@ const typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
histoNeigh[label] += 1;
}
}
std::vector< std::pair<PixelType, unsigned int> > histoNeighVec;
std::copy(histoNeigh.begin(), histoNeigh.end(), std::back_inserter(histoNeighVec));
const typename std::vector<std::pair<PixelType, unsigned int> >::iterator histoIt = histoNeighVec.begin();
...
...
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