How could I add customised shapes and frames into live webcam preview?

6 views (last 30 days)
The camera preview function is a fixed function of 'preview(cam,himage)', the himage only decide the properties of the preview window. What I am trying to achieve is to add an ecliipse in a specific position of the picture and fixed there. No object tracking or movement required. I am only wondering if I can alter a fixed part of the picture in every frame of the preview picture.
Is there anyway to do it? Is the preview windoe unable to be altered? or Could I change the preview pictures into a figure window?

Answers (1)

Raunak Gupta
Raunak Gupta on 21 Feb 2020
Hi,
You may use snapshot for the Webcam to return an image on which the shapes and frame can be plotted using either rectangle or using insertShape if the shape is simple one. You may find the Face detection example useful for setting up the VideoPlayer which can be used to output the Webcam frame by frame.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!