图像金字塔

 

 

image = imread('image.jpg')
show(image)
#5个像素的加权平均值
#像素降低
for i in range(4):
    image = cv2.pyrDown(image)
    print(image.shape)
    show(image)
#像素提高
for i in range(4):
    image = cv2.pyrUp(image)
    print(image.shape)
    show(image)
# 拉普拉斯金字塔
image = imread('image.jpg')
down_image1 = cv2.pyrDown(image)
down_image2 = cv2.pyrDown(down_image1)
up_image = cv2.pyrUp(down_image2)
laplacian = down_image1-up_image
show(laplacian)

 

posted @ 2020-08-30 09:13  yunshangyue  阅读(167)  评论(0编辑  收藏  举报