Home > other >  Python3 numpy pictures
Python3 numpy pictures

Time:10-01

 

The import numpy as np
The from PIL import Image

Image=image. Open (' show. JPG)
Image=np. Array (image)

Print (' all output from the initial 0 to 10 pixels',)



This print I got no idea, if it is the custom of one dimensional array can also be used [0:10:1] in the form of output, but the picture is the output of a lot of, but also not want data, ask

CodePudding user response:

The result does not meet your expectations, don't know what your expectations are,
First of all, the image is not a one dimensional array, you can print his shape to see
 print (image shape) 

CodePudding user response:

Print out the result is:
(1080, 1920, 3)
I want this array is 0 to 10, although I could write a loop to obtain, but the feeling is very LOW, numpy should have a own method, the multidimensional slice, but I always don't come out, some don't conform to baidu
  • Related