diff --git a/Code/BasicFilters/otbLabelImageRegionPruningFilter.txx b/Code/BasicFilters/otbLabelImageRegionPruningFilter.txx index ff7b96894162668653d554f8a6b037477cc4c076..adb7b0c23238add2580206ca2f4bd81d22736ff0 100644 --- a/Code/BasicFilters/otbLabelImageRegionPruningFilter.txx +++ b/Code/BasicFilters/otbLabelImageRegionPruningFilter.txx @@ -237,7 +237,7 @@ LabelImageRegionPruningFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe for(LabelType curLabel = 1; curLabel <= regionCount; ++curLabel) { - if(m_PointCounts[curLabel] > m_MinRegionSize) + if((m_PointCounts[curLabel] ==0) || (m_PointCounts[curLabel] > m_MinRegionSize)) { // do not process empty regions continue;