mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-02 13:03:48 +08:00
Added testcase
This commit is contained in:
@@ -5,14 +5,15 @@ def threshold_cut(label, rag, thresh):
|
||||
|
||||
#print [rag.edges_iter(data = True)]
|
||||
to_remove = [(x,y) for x,y,d in rag.edges_iter(data = True) if d['weight'] >= thresh]
|
||||
print "edges to remove",len(to_remove)
|
||||
#print "edges to remove",len(to_remove)
|
||||
|
||||
rag.remove_edges_from(to_remove)
|
||||
|
||||
#print "to remove", to_remove
|
||||
|
||||
comps = nx.connected_components(rag)
|
||||
out = np.copy(label)
|
||||
print "comps",len(comps)
|
||||
#print "comps",len(comps)
|
||||
|
||||
for i, nodes in enumerate(comps) :
|
||||
|
||||
|
||||
Reference in New Issue
Block a user