Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

FUNCTIONS

clc - Clear Command Window


This MATLAB function clears all the text from the Command Window, resulting in a clear screen.

clear - Remove items from workspace, freeing up system memory


This MATLAB function removes all variables from the current workspace, releasing them from system
memory.

close - Close one or more figures


This MATLAB function closes the current figure.

VideoReader - Create object to read video files


Use a VideoReader object to read files containing video data.

vision.VideoPlayer - Play video or display image


Play a video or display image sequences.

vision.CascadeObjectDetector - Detect objects using the Viola-Jones algorithm


The cascade object detector uses the Viola-Jones algorithm to detect people’s faces, noses, eyes, mouth,
or upper body.
hasFrame - Determine if video frame is available to read
This MATLAB function returns logical 1 (true) if there is a video frame available to read from the file.

readFrame - Read next video frame


This MATLAB function reads the next available video frame from the file associated with v.

Step - Generate step function


The Step block provides a step between two definable levels at a specified time.

insertObjectAnnotation - Annotate truecolor or grayscale image or video stream


This MATLAB function returns a truecolor image annotated with shape and label at the location specified
by position.

release - Release COM interface


This MATLAB function releases the interface and all resources used by the interface.
SOURCE CODE

PROGRAM:
clc;
clear all;
close all;

videoFile = 'C:\Users\user\OneDrive\Pictures\Camera Roll';

videoReader = VideoReader('testMy.mp4');

videoPlayer = vision.VideoPlayer;

faceDetector = vision.CascadeObjectDetector();

while hasFrame(videoReader)

frame = readFrame(videoReader);

bbox = step(faceDetector, frame);

detectedFrame = insertObjectAnnotation(frame, 'rectangle', bbox, 'Face');

step(videoPlayer, detectedFrame);

end

release(videoPlayer);

You might also like