opencv图像特效之图像融合

import cv2
import numpy as np

img0 = cv2.imread("E:/code/conputer_visual/data/01.jpg",1)
img1 = cv2.imread("E:/code/conputer_visual/data/02.jpg",1)
imginfo = img0.shape
height = imginfo[0]
width = imginfo[1]
dst = cv2.addWeighted(img0,0.7,img1,0.3,10) #参数10为透明度调节
cv2.imshow("dst", dst)
print(dst.shape)
cv2.waitKey()

原图

在这里插入图片描述
在这里插入图片描述

图1占比0.7图2占比0.3融合后在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/cyj5201314/article/details/114647494