Skip to content

Instantly share code, notes, and snippets.

@qfgaohao
Created June 22, 2017 19:13
Show Gist options
  • Save qfgaohao/e85058a3509aaf0e9e79144665421d5e to your computer and use it in GitHub Desktop.
Save qfgaohao/e85058a3509aaf0e9e79144665421d5e to your computer and use it in GitHub Desktop.
get a pyramid of an image and show multiple images in one notebook cell.
# modified from http://scikit-image.org/docs/stable/auto_examples/transform/plot_pyramid.html#sphx-glr-auto-examples-transform-plot-pyramid-py
import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage.transform import pyramid_gaussian
image = data.astronaut()
pyramid = tuple(pyramid_gaussian(image, max_layer=3, downscale=2)) #three images with size of orignial, image/2, image/4
for (i, p) in enumerate(pyramid):
plt.imshow(p)
plt.figure(i + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment