Face Detection and Tracking Using Live Video Acquisition This example shows how to automatically detect and track a face in a live video stream, using the KLT algorithm.

Open This Example

Overview Setup Detection and Tracking References

Overview Object detection and tracking are important in many computer vision applications including activity recognition, automotive safety, and surveillance. In this example you will develop a simple system for tracking a single face in a live video stream captured by a webcam. MATLAB provides webcam support through a Hardware Support Package, which you will need to download and install in order to run this example. The support package is available via the Support Package Installer. The face tracking system in this example can be in one of two modes: detection or tracking. In the detection mode the you can use a vision.CascadeObjectDetector object to detect a face in the current frame. If a face is detected, then you must detect corner points on the face, initialize a vision.PointTracker object, and then switch to the tracking mode. In the tracking mode, you must track the points using the point tracker. As you track the points, some of them will be lost because of occlusion. If the number of points being tracked falls below a threshold, that means that the face is no longer being tracked. You must then switch back to the detection mode to try to re­acquire the face.

Setup Create objects for detecting faces, tracking points, acquiring and displaying video frames. % Create the face detector object. faceDetector = vision.CascadeObjectDetector(); % Create the point tracker object. pointTracker = vision.PointTracker('MaxBidirectionalError', 2); % Create the webcam object. cam = webcam(); % Capture one frame to get its size. videoFrame = snapshot(cam); frameSize = size(videoFrame); % Create the video player object. videoPlayer = vision.VideoPlayer('Position', [100 100 [frameSize(2), frameSize(1)]+30]);

Detection and Tracking Capture and process video frames from the webcam in a loop to detect and track a face. The loop will run for 400 frames or until the video player window is closed. runLoop = true; numPts = 0; frameCount = 0; while runLoop && frameCount < 400     % Get the next frame.     videoFrame = snapshot(cam);     videoFrameGray = rgb2gray(videoFrame);     frameCount = frameCount + 1;     if numPts < 10         % Detection mode.         bbox = faceDetector.step(videoFrameGray);         if ~isempty(bbox)             % Find corner points inside the detected region.

            points = detectMinEigenFeatures(videoFrameGray, 'ROI', bbox(1, :));             % Re‐initialize the point tracker.             xyPoints = points.Location;             numPts = size(xyPoints,1);             release(pointTracker);             initialize(pointTracker, xyPoints, videoFrameGray);             % Save a copy of the points.             oldPoints = xyPoints;             % Convert the rectangle represented as [x, y, w, h] into an             % M‐by‐2 matrix of [x,y] coordinates of the four corners. This             % is needed to be able to transform the bounding box to display             % the orientation of the face.             bboxPoints = bbox2points(bbox(1, :));             % Convert the box corners into the [x1 y1 x2 y2 x3 y3 x4 y4]             % format required by insertShape.             bboxPolygon = reshape(bboxPoints', 1, []);             % Display a bounding box around the detected face.             videoFrame = insertShape(videoFrame, 'Polygon', bboxPolygon, 'LineWidth'             % Display detected corners.             videoFrame = insertMarker(videoFrame, xyPoints, '+', 'Color', 'white'         end     else         % Tracking mode.         [xyPoints, isFound] = step(pointTracker, videoFrameGray);         visiblePoints = xyPoints(isFound, :);         oldInliers = oldPoints(isFound, :);         numPts = size(visiblePoints, 1);         if numPts >= 10             % Estimate the geometric transformation between the old points             % and the new points.             [xform, oldInliers, visiblePoints] = estimateGeometricTransform(...                 oldInliers, visiblePoints, 'similarity', 'MaxDistance', 4);             % Apply the transformation to the bounding box.             bboxPoints = transformPointsForward(xform, bboxPoints);             % Convert the box corners into the [x1 y1 x2 y2 x3 y3 x4 y4]             % format required by insertShape.             bboxPolygon = reshape(bboxPoints', 1, []);             % Display a bounding box around the face being tracked.             videoFrame = insertShape(videoFrame, 'Polygon', bboxPolygon, 'LineWidth'             % Display tracked points.             videoFrame = insertMarker(videoFrame, visiblePoints, '+', 'Color'             % Reset the points.             oldPoints = visiblePoints;             setPoints(pointTracker, oldPoints);         end     end     % Display the annotated video frame using the video player object.     step(videoPlayer, videoFrame);     % Check whether the video player window has been closed.     runLoop = isOpen(videoPlayer); end

% Clean up. clear cam; release(videoPlayer); release(pointTracker); release(faceDetector);

References Viola, Paul A. and Jones, Michael J. "Rapid Object Detection using a Boosted Cascade of Simple Features", IEEE CVPR, 2001. Bruce D. Lucas and Takeo Kanade. An Iterative Image Registration Technique with an Application to Stereo Vision. International Joint Conference on Artificial Intelligence, 1981. Carlo Tomasi and Takeo Kanade. Detection and Tracking of Point Features. Carnegie Mellon University Technical Report CMU­CS­91­132, 1991. Jianbo Shi and Carlo Tomasi. Good Features to Track. IEEE Conference on Computer Vision and Pattern Recognition, 1994. Zdenek Kalal, Krystian Mikolajczyk and Jiri Matas. Forward­Backward Error: Automatic Detection of Tracking Failures. International Conference on Pattern Recognition, 2010

Face Detection and Tracking Using Live Video Acquisition - MATLAB ...

Face Detection and Tracking Using Live Video Acquisition - MATLAB & Simulink Example.pdf. Face Detection and Tracking Using Live Video Acquisition ...

365KB Sizes 4 Downloads 360 Views

Recommend Documents

Face Detection Using Skin Likelihood for Digital Video ...
This project is based on self-organizing mixture network (SOMN) & skin color ... develop accurate and robust models for image data, then use the Gaussian ...

2009_TRR_Draft_Video-Based Vehicle Detection and Tracking Using ...
2009_TRR_Draft_Video-Based Vehicle Detection and Tracking Using Spatiotemporal Maps.pdf. 2009_TRR_Draft_Video-Based Vehicle Detection and Tracking ...

Human Motion Detection and Tracking for Video ...
Gradients combined with ADABOOST learning to search for humans in an image .... Frame (b) Background Subtracted Frame with motion region detected (c). Extraction of image ... E. Light Support Vector Machine – Training and Testing. The classificatio

Face Detection using SURF Cascade
rate) for the detection-error tradeoff. Although some re- searches introduced intermediate tuning of cascade thresh- old with some optimization methods [35, 2, ...

Face Detection Using SURF Cascade
Face Detection Using SURF Cascade. Jianguo Li, Tao Wang, Yimin Zhang ... 13000 faces from GENKI/FaceTracer database. • With mirrors and resampling to ...

Human eye sclera detection and tracking using a ...
Keywords: Human eye detection; Eye sclera motion tracking; Time-adaptive SOM; TASOM; .... rectly interact with the eye tracking system when it is in oper- ation ...

Occupant tracking and posture detection using low ...
The source of the data comes from the low resolution infrared imager which is .... The control room consists of driver communication system and STISIM control.

Driver Fatigue Detection Using Eye Tracking and ...
ISSN 2001-5569. Driver Fatigue Detection Using Eye Tracking and Steering. Wheel Unit System. B.C.Muruga kumary1, MR.Vinoth James 2. 1Student, M.E. Embedded System Technologies, 2Asst. ... The main idea behind this project is to develop a nonintrusive

Extraction Of Head And Face Boundaries For Face Detection ieee.pdf
Loading… Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Extraction Of ... ction ieee.pdf. Extraction Of H ... ection ieee.pdf. Open. Extract. Open wit

Cell Tracking in Video Microscopy Using Bipartite Graph ... - IEEE Xplore
Automated visual tracking of cells from video microscopy has many important biomedical applications. In this paper, we model the problem of cell tracking over pairs of video microscopy image frames as a minimum weight matching problem in bipartite gr

Cell Tracking in Video Microscopy Using Bipartite ...
Automated visual tracking of cells from video microscopy has many important biomedical applications. In this paper, we model the problem of cell tracking over ...

Face Detection Methods: A Survey
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 11, November, 2013, Pg. 282-289 ... 1Student, Vishwakarma Institute of Technology, Pune University. Pune .... At the highest level, all possible face candidates are fo

Automated Detection of Engagement using Video-Based Estimation of ...
Abstract—We explored how computer vision techniques can be used to detect ... supervised learning for detection of concurrent and retrospective self-reported engagement. ...... [49] P. Ekman and W. V. Friesen, Facial Action Coding System: A ... [On

Video Concept Detection Using Support Vector Machine with ...
Video Concept Detection Using Support Vector Machine with Augmented. Features. Xinxing Xu. Dong Xu. Ivor W. Tsang ... port Vector Machine with Augmented Features (AFSVM) for video concept detection. For each visual ..... International Journal of Comp

Automated Detection of Engagement using Video-Based Estimation of ...
Abstract—We explored how computer vision techniques can be used to detect engagement while ... supervised learning for detection of concurrent and retrospective self-reported engagement. ...... [Online]. Available: http://msdn.microsoft.com/en-us/l

Face Video Competition - Springer Link
web-cams and mobile devices embedded with a camera, it is now possible to re- ... Note that NIST MBGC aims at “portal application” where the task is to ... protocols reported in [4], when g1 is used as a development set (to build the user's.

Matlab Data Acquisition and Control Toolbox for Basic ...
See [6] for further details on serial communication and DB-9 serial cable. C. Matlab ..... Figure 6: DC Motor test-bed with notebook PC and BS2 microcontroller.

Matlab Data Acquisition and Control Toolbox for Basic ...
Section III, we describe our software interface in detail. In. Section IV, we provide details on the software integration of. Simulink with the BS2 microcontroller.

Face Tracking and Recognition with Visual Constraints in Real-World ...
... constrain term can be found at http://seqam.rutgers.edu/projects/motion/face/face.html. ..... [14] Y. Li, H. Ai, T. Yamashita, S. Lao, and M. Kawade. Tracking in.

Face Detection Algorithm based on Skin Detection ...
systems that analyze the information contained in face images ... characteristics such as skin color, whose analysis turns out to ..... software version 7.11.0.584.

TRACKING FAILURE DETECTION BY IMITATING ...
School of Electrical Engineering and Computer Science, ASRI. Seoul National University, Seoul, .... the framework of online GMM method [7]. 1X(1), ..., X(t)l is a ...

pdf-0738\face-detection-and-recognition-on-mobile-devices-by ...
pdf-0738\face-detection-and-recognition-on-mobile-devices-by-haowei-liu.pdf. pdf-0738\face-detection-and-recognition-on-mobile-devices-by-haowei-liu.pdf.

Read Video Files - MATLAB & Simulink.pdf
Read Video Files - MATLAB & Simulink.pdf. Read Video Files - MATLAB & Simulink.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Read Video ...