The editor below will share with you an article about how to output a two-dimensional array as a picture in Python. It has a good reference value and I hope it will be helpful to everyone. Let’s follow the editor and take a look
For two-dimensional arrays, img_mask
##
[[ 0 0 0 ..., 7 7 7] [ 0 0 0 ..., 7 7 7] [ 0 0 0 ..., 7 7 7] ..., [266 266 266 ..., 253 253 253] [266 266 266 ..., 253 253 253] [266 266 266 ..., 253 253 253]]
The code displayed as a picture is:
##
import matplotlib.pyplot as pyplot pyplot.imshow(im_mask)
The above is the detailed content of Python implements two-dimensional array output as picture_python. For more information, please follow other related articles on the PHP Chinese website!