opencv-图像融合(高斯金字塔,拉普拉斯金字塔)

目标:两张图片自然结合无边界

使用传统numpy 直接将两张图片分开并拼接hstack,会有明显边界
使用Gaussian Pyramids 和 Laplacian Pyramids 结合两张图

  • 步骤:
  1. Load the two images of apple and orange
  2. Find the Gaussian Pyramids for apple and orange (level6)
  3. From Gaussian Pyramids .find their Laplacian Pyramids
  4. Now join the left half of apple and right half of orange in each levels of Laplacian Pyramids
  5. 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

你可能感兴趣的:(opencv)