Add test case for number of labels

This commit is contained in:
Johannes Schönberger
2013-04-09 22:54:57 +02:00
parent 9fc3f3d77f
commit ecdfd518c6
+8
View File
@@ -82,6 +82,14 @@ class TestConnectedComponents:
[-1, 0, -1],
[-1, -1, -1]])
def test_return_num(self):
x = np.array([[1, 0, 6],
[0, 0, 6],
[5, 5, 5]])
assert_array_equal(label(x, return_num=True)[1], 4)
assert_array_equal(label(x, background=0, return_num=True)[1], 3)
if __name__ == "__main__":
run_module_suite()