Opencv / python: draw image via webcam stream

Hi everyone, I am trying to make a game with my webcam where I need some objects to fall on the screen while I was streaming a video with my webcam (this stream was my background).

Question: How do I draw an image over this background? I know how to capture each frame and that I need to draw the image over the frames, but using what?

  • For this I am using python and opencv and the cv2 module .
  • I already searched and I found that you can use regions. Interest in this, but I am using cv2, and they say that using numpy arrays which is much easier .. but I don’t understand how to do that ..

Can anyone give me some advice or examples on how to do this?

Thanks in advance!

+3


source to share


1 answer


Here's an example. It also shows you how to overlay transparent images. You can use the built-in drawing functions . There's a neat little trick for drawing transparent shapes too.



+1


source







All Articles