Below is the code to add two images using OpenCV:
|
But sometimes we don’t want to do a simple addition to the image, so this case we have mix. This is also adding an image, but different weights are assigned to the weights so that it gives the feeling of mixing or transparency. Images are added according to the equation below:
g (x) = (1 -) f (x) + f1 (x)
Modifying 0 -" 1, you can make a steep transition between one image to another. Here, two images are taken to blend together. The first image has a weight of 0.3 and the second image is 0.7, cv2.addWeighted () applies the following equation to the image:
img =. img1 +. img 2 +
Taken as zero here.
Below is the code for mixing images using OpenCV:
|