Created
June 22, 2017 19:13
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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