Enlarging images
Have you ever tried resizing an image to make it larger? This usually results in loss of quality, with the enlarged image looking blurry.
The good news is that the algorithm used by scikit-image works very well for enlarging images up to a certain point.
In this exercise you'll enlarge an image three times!!
You'll do this by rescaling the image of a rocket, that will be loaded from the data module.
Diese Übung ist Teil des Kurses
Image Processing in Python
Anleitung zur Übung
- Import the module and function needed to enlarge images, you'll do this by rescaling.
- Import the
datamodule. - Load the
rocket()image fromdata. - Enlarge the
rocket_imageso it is 3 times bigger, with the anti aliasing filter applied. Make sure to setmultichanneltoTrueor you risk your session timing out!
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Import the module and function to enlarge images
from skimage.____ import ____
# Import the data module
from skimage import ____
# Load the image from data
rocket_image = ____.____()
# Enlarge the image so it is 3 times bigger
enlarged_rocket_image = ____(rocket_image, ____, ____=____, multichannel=____)
# Show original and resulting image
show_image(rocket_image)
show_image(enlarged_rocket_image, "3 times enlarged image")