I have two images and a mask. The first image (im1)
is my source image, the second (im2)
is the image whose region need to be inserted in im1
and the third image (mask)
contains 1's in the region that needs to be pasted. All images have the same size (H*W*3)
. It should be noted that im1
is HDR( .exr format).
After reading via OpenCV
im1 = .imread(im1, cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)[:,:,0:3]
im2 = ...
mask = ...
how can I transfer the masked region(contained in mask
array) of image im2
without any loss of information (no change apart from masked region) in im1
?