diff --git a/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx b/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx index d4e85ae8709b0c3d2a7dfc8ec7b88f5bff2a37f5..789702283b168212793cf44b2a6b58915eefc31b 100644 --- a/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx +++ b/Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx @@ -69,21 +69,21 @@ typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage, } else { - //Extraction of the more representative Label in the neighborhood (majorityLabel) and its Frequency (majorityFreq) - majorityFreq = histoNeighVec[0].second; //Frequency - majorityLabel = histoNeighVec[0].first; //Label - //If the majorityLabel is NOT unique in the neighborhood - if(histoNeighVec[1].second == majorityFreq && histoNeighVec[1].first != majorityLabel) - { - if (m_KeepOriginalLabelBool == true) - { - majorityLabel = centerPixel; - } - else + //Extraction of the more representative Label in the neighborhood (majorityLabel) and its Frequency (majorityFreq) + majorityFreq = histoNeighVec[0].second; //Frequency + majorityLabel = histoNeighVec[0].first; //Label + //If the majorityLabel is NOT unique in the neighborhood + if(histoNeighVec[1].second == majorityFreq && histoNeighVec[1].first != majorityLabel) { - majorityLabel = m_LabelForUndecidedPixels; + if (m_KeepOriginalLabelBool == true) + { + majorityLabel = centerPixel; + } + else + { + majorityLabel = m_LabelForUndecidedPixels; + } } - } } @@ -91,12 +91,12 @@ typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage, }//END if (centerPixel != m_LabelForNoDataPixels) //If (centerPixel == m_LabelForNoDataPixels) -else - { - majorityLabel = m_LabelForNoDataPixels; - } + else + { + majorityLabel = m_LabelForNoDataPixels; + } -return majorityLabel; + return majorityLabel; } template<class TInputImage, class TOutputImage, class TKernel>