使用 OpenCV 混合多个图像 [英] Blending multiple images with OpenCV

查看:60
本文介绍了使用 OpenCV 混合多个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用python将多个图像与OpenCV混合的方法是什么?我遇到了以下代码段:

What is the way to blend multiple images with OpenCV using python? I came across the following snippet:

img = cv2.addWeighted(mountain, 0.3, dog, 0.7, 0) 

https://docs.opencv.org/3.4/d5/dc4/tutorial_adding_images.html

显示了一种混合 2 个图像 mountaindog 的方法.如果我想混合 2 个以上的图像怎么办?我怎么能这样做?

that shows a way to blend 2 images mountain and dog. What if I want to blend more than 2 images? How could I do this?

推荐答案

试试这个:

blendedImage = weight_1 * image_1 + weight_2 * image_2 + ... + weight_n * image_n

blendedImage = weight_1 * image_1 + weight_2 * image_2 + ... + weight_n * image_n

这篇关于使用 OpenCV 混合多个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆