Sean Dong
Sean Dong

Reputation: 615

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?

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)

enter image description here

Upvotes: 1

Views: 943

Answers (2)

Mick
Mick

Reputation: 25471

OpenCV (https://opencv.org) will allow you take your video feed, and frame by frame:

  • 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.

Upvotes: 1

moisu
moisu

Reputation: 343

I have used something similar with the GraphicOverlay for text.

Also, ViewOverlay may be something to look into.

Upvotes: 0

Related Questions