HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
Practical13.docx
1. Practical –13
Aim: write the program for face detection in matlab.
Theory:
Syntax for Using the Object Detector
bbox = detector(I)
bbox = detector(I,roi)
Description of the Syntax
bbox = detector(I) returns bbox, an M-by-4 matrix, that defines ‘M’ bounding boxes that contain
the detected objects.
bbox = detector(I,roi) is used for detecting objects within the rectangular region of interest,
specified by roi.
Input Arguments
I — Input image: It is specified as true color or grayscale (RGB).
model — Classification model: It is specified as a character vector and describes the object type
to be detected.
XMLFILE — Custom classification model: Specified as an XML file, it can be created using
OpenCV training functionality or the trainCascadeObjectDetector function.
roi — Rectangular region of interest: A four-element vector [x y width height] is used to specify
this input argument.
Step=1
%to detect face
FaceDetector = vision.CascadeObjectDetector():
Step=2
%read input image
Cam = webcam(1);