diff --git a/Code/BasicFilters/otbLabelImageRegionMergingFilter.txx b/Code/BasicFilters/otbLabelImageRegionMergingFilter.txx index 4a3b8b6967b8486f531eacb0228a4ca4416000c2..0e42f29ea7772ad5ecee633764dda410c8cc070e 100644 --- a/Code/BasicFilters/otbLabelImageRegionMergingFilter.txx +++ b/Code/BasicFilters/otbLabelImageRegionMergingFilter.txx @@ -182,14 +182,17 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe unsigned int regionCount = regionAdjacencyMap.size() - 1; // Initialize arrays for mode information + m_CanonicalLabels.clear(); m_CanonicalLabels.resize(regionCount+1); - m_Modes.resize(0); + m_Modes.clear(); m_Modes.reserve(regionCount+1); for(unsigned int i = 0; i < regionCount+1; ++i) { m_Modes.push_back( SpectralPixelType(m_NumberOfComponentsPerPixel) ); } + + m_PointCounts.clear(); m_PointCounts.resize(regionCount+1); // = std::vector<unsigned int>(regionCount+1); //std::cout << "Associate each label to a spectral value" << std::endl;