目标:两张图片自然结合无边界
使用传统numpy 直接将两张图片分开并拼接hstack,会有明显边界
使用Gaussian Pyramids 和 Laplacian Pyramids 结合两张图
- 步骤:
- Load the two images of apple and orange
- Find the Gaussian Pyramids for apple and orange (level6)
- From Gaussian Pyramids .find their Laplacian Pyramids
- Now join the left half of apple and right half of orange in each levels of Laplacian Pyramids
- Finally from this joint image pyramids,reconstruct the original image
** 图片是opencv官方下载的图片库**
可以先看看浅墨写的[OpenCV图像金字塔](https://blog.csdn.net/poem_qianmo/article/details/26157633)
import numpy as np
import cv2 as cv
# laod images
apple = cv.imread(r"C:\Users\amy\Desktop\OpenCV\opencv-master\samples\data\apple.jpg")
orange = cv.imread(r"C:\Users\amy\Desktop\OpenCV\opencv-master\samples\data\orange.jpg")
pr