mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-27 11:27:08 +08:00
Minor Foramtting
This commit is contained in:
@@ -34,7 +34,6 @@ def threshold_cut(label, rag, thresh):
|
||||
"""
|
||||
to_remove = [(x, y) for x, y, d in rag.edges_iter(data=True)
|
||||
if d['weight'] >= thresh]
|
||||
|
||||
rag.remove_edges_from(to_remove)
|
||||
|
||||
comps = nx.connected_components(rag)
|
||||
|
||||
@@ -16,10 +16,7 @@ def test_threshold_cut():
|
||||
labels[50:, :50] = 2
|
||||
labels[50:, 50:] = 3
|
||||
|
||||
# print labels
|
||||
rag = graph.rag_meancolor(img, labels)
|
||||
# print "no of edges",rag.number_of_edges()
|
||||
new_labels = graph.threshold_cut(labels, rag, 10)
|
||||
|
||||
assert new_labels.max() == 2
|
||||
# assert False
|
||||
|
||||
Reference in New Issue
Block a user