From 344e2a51c0cd4ec79843805393514402f1a18df9 Mon Sep 17 00:00:00 2001 From: Vighnesh Birodkar Date: Fri, 15 Aug 2014 17:52:25 +0530 Subject: [PATCH] cast labels in ncut --- skimage/graph/graph_cut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/graph/graph_cut.py b/skimage/graph/graph_cut.py index 3f973e22..10ea77c4 100644 --- a/skimage/graph/graph_cut.py +++ b/skimage/graph/graph_cut.py @@ -120,7 +120,7 @@ def cut_normalized(labels, rag, thresh=0.001, num_cuts=10, in_place=True): _ncut_relabel(rag, thresh, num_cuts) - map_array = np.zeros(labels.max() + 1) + map_array = np.zeros(labels.max() + 1, dtype=labels.dtype) # Mapping from old labels to new for n, d in rag.nodes_iter(data=True): map_array[d['labels']] = d['ncut label']