% Create a cascade detector object.
faceDetector = vision.CascadeObjectDetector();
% Read a video frame and run the face detector.
videoFileReader = vision.VideoFileReader(infilename);
videoFrame = step(videoFileReader);
bbox = step(faceDetector,videoFrame);
上面code中,第二个step会call CascadeObjectDetector.m
%CascadeObjectDetector Detect objects using the Viola-Jones algorithm
% DETECTOR = vision.CascadeObjectDetector creates a System object
% that detects objects using the Viola-Jones algorithm. The DETECTOR
% is capable of detecting a variety of objects, including faces and a
% person's upper body. The type of object to detect is controlled by
% the ClassificationModel property. By default, the DETECTOR is
% configured to detect faces.
%
% …………
%
% BBOXES = step(DETECTOR,I) performs multi-scale object detection