问题
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).
The question is: how do I draw the image over this background? I know how to capture each frame and that I have to draw the image over the frames, but using what?
- For this I am using python and opencv and the cv2 module.
- Ive already searched and I discovered that you can use regions of interest to do that but I am using cv2 and it is said that using the numpy arrays that is much simpler.. but I dont understand how to do that..
Can anyone give me some tips or examples of how to do this?
Thanks in advance!
回答1:
Here's an example. It shows how to overlay transparent images too. You can use the built in draw functions as well. There's a neat little trick to draw transparent shapes too.
来源:https://stackoverflow.com/questions/14540210/opencv-python-draw-image-over-a-webcam-stream