mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-15 12:54:54 +08:00
Fixed tests
This commit is contained in:
@@ -146,17 +146,15 @@ def test_rag_hierarchical():
|
|||||||
|
|
||||||
g = graph.rag_mean_color(img, labels)
|
g = graph.rag_mean_color(img, labels)
|
||||||
g2 = g.copy()
|
g2 = g.copy()
|
||||||
thresh = 20 # more than 11*sqrt(3)
|
thresh = 20 # more than 11*sqrt(3) but less than
|
||||||
|
|
||||||
result = merge_hierarchical_mean_color(labels, g, thresh)
|
result = merge_hierarchical_mean_color(labels, g, thresh)
|
||||||
assert(np.all(result[0:4, 0:4] == result[0, 0]))
|
assert(np.all(result[:, :4] == result[0, 0]))
|
||||||
assert(np.all(result[4:, 0:4] == result[4, 0]))
|
|
||||||
assert(np.all(result[:, 4:] == result[-1, -1]))
|
assert(np.all(result[:, 4:] == result[-1, -1]))
|
||||||
|
|
||||||
result = merge_hierarchical_mean_color(labels, g2, thresh,
|
result = merge_hierarchical_mean_color(labels, g2, thresh,
|
||||||
in_place_merge=True)
|
in_place_merge=True)
|
||||||
assert(np.all(result[0:4, 0:4] == result[0, 0]))
|
assert(np.all(result[:, :4] == result[0, 0]))
|
||||||
assert(np.all(result[4:, 0:4] == result[4, 0]))
|
|
||||||
assert(np.all(result[:, 4:] == result[-1, -1]))
|
assert(np.all(result[:, 4:] == result[-1, -1]))
|
||||||
|
|
||||||
result = graph.cut_threshold(labels, g, thresh)
|
result = graph.cut_threshold(labels, g, thresh)
|
||||||
|
|||||||
Reference in New Issue
Block a user