From 1e39dfc7a1ae8e5942b9916749b44ce7af4fed33 Mon Sep 17 00:00:00 2001 From: Vighnesh Birodkar Date: Wed, 23 Jul 2014 03:54:57 +0530 Subject: [PATCH] rectified threshold mistake --- skimage/graph/graph_cut.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skimage/graph/graph_cut.py b/skimage/graph/graph_cut.py index 3ae7b499..9f4f4789 100644 --- a/skimage/graph/graph_cut.py +++ b/skimage/graph/graph_cut.py @@ -157,16 +157,16 @@ def _ncut_relabel(rag, thresh): ev = _ncut.normalize(ev) mcut = np.inf - thresh = None + threshold = None for t in np.arange(0, 1, 0.1): mask = ev > t cost = _ncut.ncut_cost(mask, d, w) if cost < mcut: mcut = cost - thresh = t + threshold = t if (mcut < thresh): - mask = ev > thresh + mask = ev > threshold nodes1 = [n for i, n in enumerate(rag.nodes()) if mask[i]] nodes2 = [n for i, n in enumerate(rag.nodes()) if not mask[i]]