raise ValueError(""connect_diag" must be specified as True or False. "
"You provided {0}".format(connect_diag))
unique_labels = set(np.unique(np.asarray(labels_data)))
unique_labels.remove(0)
if labels is not None:
After Change
unique_labels = set(check_unique_labels)
// check for background label indicated as 0
if np.any(check_unique_labels == 0):
unique_labels.remove(0)
if labels is not None:
if (not isinstance(labels, collections.Iterable) or
isinstance(labels, _basestring)):
labels = [labels, ]