python opencv 图像叠加_Python OpenCV 之图像的叠加,图像处理取经之旅第 16 天

本文介绍了如何使用 Python 的 OpenCV 库进行图像叠加操作,主要涉及 cv2.addWeighted 函数,讲解了参数含义并提供了示例代码。此外,还探讨了如何利用 cv2.createTrackbar 创建滑动条来动态调节图像叠加效果,展示了无需滑动条的渐变切换效果。
摘要由CSDN通过智能技术生成

今天的学习的内容是:通过 Python OpenCV 对图像实现叠加操作,本文只涉及一个函数,即cv2.addWeighted。

cv2.addWeighted

该函数的完整表述为:Python-OpenCV 图像叠加 or 图像混合加权实现。

函数原型如下:

dst = cv2.addWeighted(src1, alpha, src2, beta, gamma[, dst[, dtype]])

参数说明(哈哈,这是官方的,点击打开官方说明):

src1 – first input array.

alpha – weight of the first array elements.

src2 – second input array of the same size and channel number as src1.

beta – weight of the second array elements.

dst – output array that has the same size and number of channels as the input arrays.

gamma – scalar added to each sum.

dtype – optional depth of the output array; when both input arrays have the same depth, dtype can be set to -1, which will be equivalent to src1.depth().

参数翻译如下:

src1, src2:需要融合叠加的两副图像,要求大小和通道数相等

alpha:src1 的权重<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值