Q:

OpenCV Mask Error error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'cv::binary_op

I am getting this error:
cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:245: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'cv::binary_op' 

I've read this post which describes my problem (other questions don't), but I couldn't find my answer from there.
here's my code:
import cv2
import numpy as np
from matplotlib import pyplot as plt

img = cv2.imread("manzara.jpg")
imgOther = cv2.imread("fuzuli.jpg") # shape of this is 559, 419, 3

width, height, channel = img.shape # 768, 1024, 3
roi = img[0:width, 0:height]
imgOtherGray = cv2.cvtColor(imgOther, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(imgOtherGray, 220, 255, cv2.THRESH_BINARY_INV)

antiMask = cv2.bitwise_not(mask)

img_background = cv2.bitwise_and(roi, roi, mask=antiMask) # where error occurs
imgOther_fg = cv2.bitwise_and(roi, roi, mask=mask)

dst = cv2.add(img_background, imgOther_fg)
img[0:width, 0:height] = dst
cv2.imshow("image", img)

A:

I've figured out that I am trying to work with wrong image named "img", img's shape is bigger than imgOther's shape, so it causes a problem. I changed the 
width, height, channel = img.shape # 768, 1024, 3
roi = img[0:width, 0:height]

code with
width, height, channel = imgOther.shape # 768, 1024, 3
roi = img[0:width, 0:height]

and my problem is solved

