Added new convex_hull_image qhull test

This commit is contained in:
Jeremy Metz
2014-02-01 16:17:53 +00:00
parent add4b51db7
commit 920c3efb83
@@ -32,6 +32,28 @@ def test_basic():
assert_array_equal(convex_hull_image(image), expected)
@skipif(not scipy_spatial)
def test_qhull_offset_example():
nonzeros = (([1367, 1368, 1368, 1368, 1369, 1369, 1369, 1369, 1369, 1370, 1370,
1370, 1370, 1370, 1370, 1370, 1371, 1371, 1371, 1371, 1371, 1371,
1371, 1371, 1371, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372,
1372, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1374,
1374, 1374, 1374, 1374, 1374, 1374, 1375, 1375, 1375, 1375, 1375,
1376, 1376, 1376, 1377]),
([151, 150, 151, 152, 149, 150, 151, 152, 153, 148, 149, 150, 151,
152, 153, 154, 147, 148, 149, 150, 151, 152, 153, 154, 155, 146,
147, 148, 149, 150, 151, 152, 153, 154, 146, 147, 148, 149, 150,
151, 152, 153, 154, 147, 148, 149, 150, 151, 152, 153, 148, 149,
150, 151, 152, 149, 150, 151, 150]))
image = np.zeros((1392, 1040), dtype=bool)
image[ nonzeros ] = True
expected = image.copy()
assert_array_equal(convex_hull_image(image), expected)
@skipif(not scipy_spatial)
def test_pathological_qhull_example():
image = np.array(