Last active
December 22, 2021 17:16
-
-
Save TuringNPcomplete/0ac945b1c911b6d0c555f92e3514d902 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def one_channel(ims, nrows=1, ncols=None, titles= None, **kwargs): | |
"Show all images 'ims' as subplots with 'rows' using 'titles'." | |
if ncols is None: ncols = int(math.ceil(len(ims)/nrows)) | |
if titles is None: titles = [None]*len(ims) | |
axs = subplots(nrows, ncols, **kwargs)[1].flat | |
for im,t,ax in zip(ims, titles, axs): | |
if im.ndim < 3: | |
show_image(im, ax = ax, title= t, cmap='gray') | |
else: | |
show_image(im, ax = ax, title= t) | |
one_channel([grayscale_avr, grayscale_w, grayscale_lu], suptitle = "Grayscale Images based on: | |
Average, Weighted Average, and Luminosity methods", | |
titles = ["Average", "Weighted Average", "Luminosity"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment