# 图像金字塔
# 高斯金字塔
import cv2 as cv
import numpy as np
img = cv.imread("./lena.png")
print(img.shape)
down = cv.pyrDown(img)
print(down.shape)
up = cv.pyrUp(img)
print(up.shape)
# laplace金字塔是通过原图像减去先下采样再上采样的图像得到残差图,为i修复信息做准备
# 拉普拉斯金字塔没有专门的函数,是由高斯金字塔构成的
# 他的大部分元素都是0,用于图像压缩
import cv2 as cv
import numpy as np
img = cv.imread("./lena.png")
down = cv.pyrDown(img)
up = cv.pyrUp(down)
lap = img - up
cv.imshow("img",lap)
cv.waitKey(0)
cv.destroyAllWindows()