Streaming Face Detection, Training, Recognition

Demonstrates live acquisition, detection, training, and recognition of faces!

You are now following this Submission

Just connect a webcam to your computer and run "streamingFaceRecognition." This demo program:
• Initializes the webcam and starts a streaming preview of the audience;
• Automatically detects faces;
• Captures a specified number of qualified face images;
• Writes them to an auto-created, labeled subdirectory;
• Asks (in a while loop) if you want to capture another face;
• Prompts one to (optionally) provide names for the faces;
• Automatically and quickly trains a recognizer.
With no downtime, continue to point the camera at the audience and detected faces will be AUTOMATICALLY LABELED!!!

Cite As

Brett Shoelson (2026). Streaming Face Detection, Training, Recognition (https://www.mathworks.com/matlabcentral/fileexchange/49914-streaming-face-detection-training-recognition), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with R2015b to R2026a

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
3.0

My original version was created in 2014, before imageSet was deprecated in favor of imageDatastore. This version updates the code to work in newer versions of MATLAB, and add some niceties. (REQUIRES the webcam support package.)

2.1.0.0

The files are the same; I simply added a "README" Doc that explains the algorithm behind the functionality herein.

2.0.0.0

I changed preprocessing and capture defaults to improve performance in a wider range of settings. Now captures 8 images per person (by default), and gives you an opportunity to discard bad captures. Should be faster and better.

1.4.0.0

Fixes an occasional error-triggering problem with mismatched image sizes. Should be more robust now.

1.3.0.0

Based on some of the comments I received, I modified some of the default parameters and fixed a couple of minor bugs. I believe that this version will be faster, and may even give better performance, than the first version.

1.1.0.0

Omits an unnecessary file.