In [1]:
import cv2
In [2]:
src1 = cv2.imread('data/src/lena.jpg')
In [3]:
src2 = cv2.imread('data/src/horse_r.png')
In [4]:
src2 = cv2.resize(src2, src1.shape[1::-1])
In [5]:
print(src2.shape)
In [6]:
print(src2.dtype)
In [7]:
dst = cv2.bitwise_and(src1, src2)
In [8]:
cv2.imwrite('data/dst/opencv_bitwise_and.jpg', dst)
Out[8]: