Pas encore de compte ?
Testé sous Anaconda et Python 3.7
# -*- coding: utf-8 -*- """ Created on Fri Jun 24 14:24:07 2022 @author: https://theailearner.com/tag/laplacian-pyramid-opencv/ """ import cv2 from matplotlib import pyplot as plt def showimage(myimage, figsize=[10,10]): if (myimage.ndim>2): #This only applies to RGB or RGBA images (e.g. not to Black and White images) myimage = myimage[:,:,::-1] #OpenCV follows BGR order, while matplotlib likely follows RGB order fig, ax = plt.subplots(figsize=figsize) ax.imshow(myimage, cmap = 'gray', interpolation = 'bicubic') plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis plt.show() # Load the color image img = cv2.imread('lena.jpg',1) lower = img.copy() # Create a Gaussian Pyramid gaussian_pyr = [lower] for i in range(5): lower = cv2.pyrDown(lower) gaussian_pyr.append(lower) showimage(lower)
Bienvenu, je m’appelle Eric Soupet et je suis l'administrateur du site elodees.com. elodees.com est un état de l'art de l'Intelligence Artificielle et se veut collaboratif, vous pouvez dès à présent proposer du contenu tels que des articles, des événements, des tutoriels, ... alors n'hésitez pas !
Crédit des images de la plate-forme : Pixabay - Pixabay License | Pexels - Pexels License