Everyone probably knows the program Zoom, which has a virtual background function. The program automatically finds a person in the frame and allows you to replace the surrounding space. In other words, a virtual background is like Chromakey without the green screen.
There is a way to include a virtual background in any Windows application. Any virtual webcam that has the appropriate functionality will help. Let's look at the example of the AlterCam program, which you can download here. Note, The virtual background function will work in AlterCam if you have Windows 10 x64 or newer!
In short, it works like this. After you install AlterCam, another webcam appears in the system - a virtual one. You can select it instead of a real camera in any application. Then you can broadcast anything to the virtual webcam. For example, a video from a real webcam with a blurred or replaced background.
In AlterCam, you can use the virtual background in several ways. For example, you can include any of dozens of effects just for the background. The most common is to use the "Blur" effect. Let's move on to the pictures. Here's a screenshot of the original video with no virtual background applied.
Notice the very first button on the "Effects" tab. It sets up a special mask of the automatically detected background for the effects to apply. By default, it automatically uses a blur effect. However, you can combine filters and turn on several at once. For example, in the screenshot below, "Blur" and "Hearts" filters are used.
By the way, you can use the second button on the "Effects" tab to invert the mask. Then the effects will apply only to the person in the frame, and the background will remain unchanged. Maybe you need to hide just the face with the filter.
Now let's look at the options for changing the background in AlterCam. To achieve this, let's go to the "Background" tab. Here, the virtual background is enabled with the checkbox. When this option is enabled, the background becomes transparent, and you need to choose what to put under the main video. By default, there is nothing to put under, and it looks like this:
A slider serves to adjust the load on the CPU. For example, if the FPS (frames per second) noticeably dropped when you enable the virtual background, you can move the slider to the right to reduce the load on the processor and reduce the precision of background-cutting. In most cases, you do not need to adjust anything. However, if you have a very high-resolution video and not the most efficient computer, you may have to move the slider to the right.
As you can see, there are several options for replacing the background. First, you can replace it with a fill of the color of your choice. However, it is not the best option because the AI artifacts may be visible on a solid-colored background. Second, you may replace the background with any selected picture. Finally, an exciting opportunity is to replace the background with a live video from your desktop. It helps conduct online lessons, webinars, presentations. Here's an example of replacing the desktop background in a live video from a webcam:
The main video layer can be scaled and moved to the desired location in the frame with the mouse right in the preview area.
This paragraph is for those interested in the technical details of how automatic background separation works. In almost all implementations that we are aware of, the virtual background is based on a neural network trained to find a person in the frame in thousands of specially marked images. Of course, this neural network still needs to be optimized to work with video in real-time. AlterCam is not an exception. Automatic background detection is implemented using machine learning AI.
To remove the webcam background when streaming, there are currently two ways - Chromakey and Virtual Background. With Chromakey, you can get a much better result, but this option is much more difficult to set up. It requires a special one-color background (usually green), evenly illuminated behind your subject. The object itself should not have the same colors as the background. A virtual background is much easier to implement, just have special software (e.g. AlterCam) and enable it with one or two mouse clicks. But even in this case, the result will be mediocre. I think you can easily tell when there is a Chromakey in the stream and when there is a virtual background.
Do you have any questions? Ask us!