Hey everyone I'm trying to make a game using my webcam where I need some objects to fall down the screen while Im streaming video with my webcam (that stream being my background).
I am using python and module cv2 of opencv
The question is: how do I apply a mask to this objects? I already have an image to be the mask of the original image but I dont know how to apply it to subtract the background of the original image..
ive already tried using the cv2.bitwise_and but nothing happened, the imaged stayed the same with black background:
#targets
original_ball = cv2.imread("Aqua-Ball-Red-icon.png")
ball = cv2.resize(bola_original, (64,64), fx=1, fy=1)
#mask
mask_original = cv2.imread("input-mask.png",0)
mask = cv2.resize(mask_original, (64,64), fx=1, fy=1)
res = cv2.bitwise_and(ball, ball, mask = mask)
Thanks in advance!