randomize_segmentation_labels

grizli.catalog.randomize_segmentation_labels(seg, random_seed=1, fill_value=nan)[source]

Randomize labels on a segmentation image for easier visualization

Parameters:
seg : str or array

Segmentation filename or integer array

random_seed : int

Random number seed for numpy.random.seed

fill_value : scalar

Value to insert where seg == 0

Returns:
rand_ids : array

1D array of the randomized labels with size max(seg)+1

rand_seg : array

2D rray with randomized labels