diff --git a/skimage/morphology/misc.py b/skimage/morphology/misc.py index fe1f27d8..3b20ef88 100644 --- a/skimage/morphology/misc.py +++ b/skimage/morphology/misc.py @@ -1,5 +1,6 @@ import numpy as np import functools +import warnings import scipy.ndimage as nd from .selem import _default_selem @@ -128,6 +129,10 @@ def remove_small_objects(ar, min_size=64, connectivity=1, in_place=False): "relabeling the input with `scipy.ndimage.label` or " "`skimage.morphology.label`.") + if len(component_sizes) == 2: + warnings.warn("Only one label was provided to `remove_small_objects`. " + "Did you mean to use a boolean array?") + too_small = component_sizes < min_size too_small_mask = too_small[ccs] out[too_small_mask] = 0