mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-09 11:33:41 +08:00
[BUG] Corrected a bug in the random walker that appeared
* when returning the full probability instead of the segmentation
* for three or more labels (two was OK)
This commit is contained in:
@@ -401,9 +401,8 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
|
||||
copy=True).reshape(dims) for Xline in X])
|
||||
for i in range(1, int(labels.max()) + 1):
|
||||
mask_i = np.squeeze(labels == i)
|
||||
X[:, mask_i] = 0
|
||||
X[i - 1, mask_i] = 1
|
||||
X[np.setdiff1d(np.arange(0, labels.max(), dtype=np.int),
|
||||
[i - 1]), mask_i] = 0
|
||||
else:
|
||||
X = _clean_labels_ar(X + 1, labels).reshape(dims)
|
||||
return X
|
||||
|
||||
Reference in New Issue
Block a user