CommencerCommencer gratuitement

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.

Rocket

Cet exercice fait partie du cours

Image Processing in Python

Afficher le cours

Instructions

  • Import the module and function needed to enlarge images, you'll do this by rescaling.
  • Import the data module.
  • Load the rocket() image from data.
  • Enlarge the rocket_image so it is 3 times bigger, with the anti aliasing filter applied. Make sure to set multichannel to True or you risk your session timing out!

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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")
Modifier et exécuter le code