Given the following images:
I'd like to blend them into the following (result.png):
I already know how to do this with Python PIL, but how do I do it with Python OpenCV?
Here is the Python PIL code for reference:
from PIL import Image
original = Image.open('original.png').convert('RGB')
background = Image.open('background.png').convert('RGB')
mask = Image.open('mask.png').convert('L')
result = Image.composite(original, background, mask)
result.save('result.png')
Can somebody help me fill in the following?:
import cv2
original = cv2.imread('original.png')
background = cv2.imread('background.png')
mask = cv2.imread('mask.png', 0)
result = ???? # What to do here?
cv2.imwrite('result.png', result)



