python图像下采样_python + opencv 如何在上采样下采样之后导出图片?

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

import cv2

def pyramid_demo(image):

level = 3

temp = image.copy()

pyramid_images = []

for i in range(level):

dst = cv2.pyrDown(temp)

pyramid_images.append(dst)

cv2.imshow("pyramid_down_"+str(i),dst)

temp = dst.copy()

return pyramid_images

def lapalian_demo(image):

pyramid_images = pyramid_demo(image)

level = len(pyramid_images)

for i in range(level-1,-1,-1):

if(i-1) <0:

expand = cv2.pyrUp(pyramid_images[i], dstsize=image.shape[:2])

lpls = cv2.subtract(image, expand)

cv2.imshow("lapalian_down_" + str(i), lpls)

else:

expand = cv2.pyrUp(pyramid_images[i], dstsize=pyramid_images[i-1].shape[:2])

lpls = cv2.subtract(pyramid_images[i-1], expand)

cv2.imshow("lapalian_down_" + str(i), lpls)

print("------------- Python OpenCV Titorial -------------")

src = cv2.imread("E://renlian//renlian1//233.jpg")

cv2.namedWindow("input image",cv2.WINDOW_AUTOSIZE)

cv2.imshow("input image",src)

# pyramid_demo(src)

lapalian_demo(src)

cv2.waitKey(0)

cv2.destroyAllWindows()

这是我的代码,可以运行,请教一下会的大神们,在我采样完之后如何把图片导出来(采样的的图片都是),试了很多方法都不行!!!

你可能感兴趣的:(python图像下采样)