简体   繁体   English

Android将实时叠加添加到相机Feed

[英]Android add real time overlay to camera feed

I am trying to add a real time overlay to video capture from the camera feed. 我正在尝试将实时叠加添加到来自摄像机供稿的视频捕获中。 Which api should I use and how? 我应该使用哪个API?如何使用?

Idea is below, 想法在下面,

  1. Get camera feed (left) 获取相机供稿(左)
  2. Generate overlay from the feed, I'm using deep models here (middle) 从提要生成叠加层,我在这里使用深层模型(中)
  3. Add overlay on top of the original video feed in real time(right) 实时在原始视频供稿顶部添加叠加(右)

在此处输入图片说明

I have used something similar with the GraphicOverlay for text. 我使用了与GraphicOverlay类似的文本。

Also, ViewOverlay may be something to look into. 此外, ViewOverlay可能值得研究。

OpenCV ( https://opencv.org ) will allow you take your video feed, and frame by frame: OpenCV( https://opencv.org )将允许您获取视频供稿,并逐帧进行:

  • load the frame 加载框架
  • analyse it and generate your overlay 分析并生成叠加
  • add your overlay to the frame (or replace the frame with your merged overlay) 将叠加层添加到框架(或将帧替换为合并的叠加层)
  • display and/or save the frame 显示和/或保存框架

Depending on the amount of processing you need to do, the platform or device you are running on and whether you need it in real time you may find it hard to complete this every frame for high frame rates. 根据您需要执行的处理量,运行的平台或设备以及是否实时需要,您可能会发现很难以高帧速率完成每一帧。 One solution to this, if it is ok for your problem domain, is to only do the processing very nth frame. 一种解决方案(如果可以解决您的问题)是仅在第n帧进行处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM