def test_binarise_a_matrix():
in_data = np.array([0, 1, 2, 3, 4])
expected_out_data = np.array([0, 1, 1, 1, 1])
assert_array_equal(expected_out_data, binarise_a_matrix(in_data, dtype=np.int))
# def test_get_values_below_label():
#
# image = np.array(range(8 * 8)).reshape(8, 8)
# mask = np.zeros_like(image)
# mask[2, 2] = 1
# mask[2, 3] = 1
# mask[3, 2] = 1
# mask[3, 3] = 1
# vals = get_values_below_label(image, mask, 1)
# assert_array_equal([image[2, 2], image[2, 3], image[3, 2], image[3, 3]], vals)
test_auxiliary_methods.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录