karttinen
karttinen

Reputation: 122

Imposing Shapes on Video Files Using Matlab

Is it possible to impose a shape, let's say rectangle, on video files in Matlab ? I know that it is easily possible to do it on image files using shape inserter but couldn't find a way to do it on videos.

So far my best guess is to extract the frames, impose the rectangles and somehow encode it again into the stream. However, I wonder if there's a more elegant way to achieve it.

Upvotes: 1

Views: 491

Answers (1)

Dima
Dima

Reputation: 39409

That's exactly the way you have to do it.

  • read a frame of video using vision.VideoFileReader
  • insert whatever annotations you need into the frame using insertShape, insertMarker, insertText, or insertObjectAnnotation
  • write the modified frame out to a new video file using vision.VideoFileWriter
  • repeat for all frames

Upvotes: 3

Related Questions