out : array, same shape and type as `image`
The output visualization.
out = np.zeros_like(image)
labels = np.unique(label_field)
bg = (labels == bg_label)
if bg.any():
labels = labels[labels != bg_label]
After Change
out : array, same shape and type as `image`
The output visualization.
out = np.zeros(label_field.shape + (3,))
labels = np.unique(label_field)
bg = (labels == bg_label)
if bg.any():
labels = labels[labels != bg_label]