今天的学习的内容是:通过 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 的权重<