zhiqingstudy

Be a young person with knowledge and content

The api of image fusion is addWeighted (A, alpha, B, bate, gamma). If two images are to be fused, their dimensions must be the same.
A: Picture A to be fused
B: Picture B to be fused
Alpha and beta: weight, respectively representing the weight of image A and image B in the fused image.
gamma:静态权重,比如gamma=100,那么所有元素都加100。
import cv2
import numpy as np

# 导入两张图片
back=cv2.imread('20220627220106.jpg')
people=cv2.imread('20220627214919.jpg')

# 查看两张图片大小是否一样
print(back.shape)
print(people.shape)

# 图片溶合
result=cv2.addWeighted(people,0.7,back,0.3,0)

# 显示溶合后的图片
cv2.imshow('result',result)
cv2.waitKey(0)

comment
head sculpture
Code:
Related

Why you shouldn't stay at a job for more than 2 years?

3 harsh facts long-distance relationships

how to keep your girlfriend interested in a long-distance relationship




Unless otherwise specified, all content on this website is original. If the reprinted content infringes on your rights, please contact the administrator to delete it
Contact Email:2380712278@qq.com

Filing number:皖ICP备19012824号