November 2018
Intermediate to advanced
492 pages
12h 19m
English
The following code block shows how to convert from the PIL Image object into numpy ndarray (to be consumed by scikit-image):
im = Image.open('../images/flowers.png') # read image into an Image object with PILim = np.array(im) # create a numpy ndarray from the Image objectimshow(im) # use skimage imshow to display the imageplt.axis('off'), show()
The next figure shows the output of the previous code, which is an image of flowers:

The following code block shows how to convert from numpy ndarray into a PIL Image object. When run, the code shows the same output as the previous figure:
im = imread('../images/flowers.png') ...Read now
Unlock full access