Stuart’s MATLAB Videos

Watch and Learn

Writing A Script to Automate the Cropping of Many Photos Using Face Detection

My colleague Tim makes a video presentation of new hires joining MathWorks for each quarterly company meeting. He likes to use uniformly cropped photos of staff members, similar to this one of when I joined 20 years ago today (I was more pixelated in those days).

But this can be time consuming to do manually, especially when we hire more than 100 staff members a quarter. So he asked if I could automate it for him. Here is my first attempt to build a script to do that.

Features covered in this code-along style video include:

  • vision.CascadeObjectDetector System object, from Computer Vision System Toolbox for the face detection
  • imread, imwrite
  • tables, and dir for extracting multiple files for processing in a loop

Play the video in full screen mode for a better viewing experience. 

|
  • print

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。