opencv/python:在网络摄像头流上绘制图像 [英] opencv/python: Draw image over a webcam stream

查看:194
本文介绍了opencv/python:在网络摄像头流上绘制图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我要尝试使用网络摄像头制作游戏的每个人都需要一些物体从屏幕上掉下来,而我正在通过网络摄像头流式传输视频(该流是我的背景).

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?

  • 为此,我使用python和opencv以及cv2模块.
  • 我已经搜索过,发现可以使用以下区域 有兴趣做到这一点,但我正在使用cv2,据说使用 numpy的数组更简单..但我不知道该怎么办 那..
  • 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?

提前谢谢!

推荐答案

内置在绘制函数中.有一个整洁的技巧可以绘制也是透明的形状.

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.

这篇关于opencv/python:在网络摄像头流上绘制图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆