import matplotlib.pyplot as pyplot pyplot.imshow(binary_mask)
pyplot.show()
binary_mask顯示為:
array([[0, 0, 0, ..., 0, 0, 0],
[0, 1, 0, ..., 0, 0, 0],
[0, 0, 1, ..., 0, 0, 0],
...,
[0, 1, 0, ..., 0, 1, 0],
[0, 0, 0, ..., 0, 0, 1],
[0, 1, 0, ..., 0, 1, 0]], dtype=uint8)
圖片顯示為: