Available at: https://digitalcommons.calpoly.edu/theses/2992
Date of Award
5-2025
Degree Name
MS in Electrical Engineering
Department/Program
Electrical Engineering
College
College of Engineering
Advisor
Jane Zhang
Advisor Department
Electrical Engineering
Advisor College
College of Engineering
Abstract
Segmentation of portrait images is an important technique used to separate the foreground and background of an image. This separation of layers is useful for selectively applying post-processing techniques to enhance the quality of the image, such as blurring the background. Automatic portrait segmentation is a complex process that can be completed with a high degree of accuracy using deep learning with neural networks, but training and inference are often very computationally expensive. This thesis aims to take a heuristic approach to portrait segmentation by combining classical image processing and computer vision techniques into a solution that can be run on lower-cost hardware. This allows a simple smartphone to emulate the visually pleasing bokeh background blur effect seen in photos taken on DSLR cameras. This thesis implements a human segmentation workflow that sequentially addresses three key areas: facial skin, hair, and the torso. After a binary mask has been generated, a Gaussian kernel is applied to the background region to introduce the blur. AiSegment.com's Human Matting Dataset and neural network output are used to evaluate the performance of the workflow, where the Intersection over Union (IoU) between masks is calculated. Across 40 test images, the percentage of images with an IoU greater than 0.75 (considered passing) was found to be 87.5% with an average IoU among passing results of 0.8619 and an average processing speed of 0.4263 seconds per image on the faster M1 Pro processor tested. These results show that the heuristic approach is a viable solution.