Credit to Eric VanBuhler for contributing the code corresponding to overlay_image and mask dilation.

In a previous post, I showed how to separate a person from a video stream and alter the background, creating a virtual green screen. In that post, the model that performed best was a coarse-grained semantic segmentation model that resulted in large, blocky segmentation edges. A more fine-grained segmentation model was not able to accurately track the person in the video stream, and using Gaussian smoothing on the more coarse-grained model blurred the entire image. In this tutorial, we’ll cover how to smooth out edges generated by coarse-grained semantic segmentation models without blurring the desired target objects.

All of the code from this tutorial is available on GitHub. To run the final code, first sign up for an alwaysAI account (it’s free!) and get it set up on your machine (also free). However, you can use the smoothing code in any Python computer vision application!

This tutorial builds off OpenCV and the virtual green screen blog post. If you’d like to follow along, first clone this repo.

Let’s get started!

#green-screen #semantic-segmentation #artificial-intelligence #computer-vision #background-removal

Smoothing Semantic Segmentation Edges
3.30 GEEK