VirtualBackgroundVideoFilter

class VirtualBackgroundVideoFilter(context: Context, @DrawableRes backgroundImage: Int, foregroundThreshold: Double = DEFAULT_FOREGROUND_THRESHOLD) : BitmapVideoFilter

Applies a virtual background (custom image) to a video call.

Parameters

context

Context used to access resources.

backgroundImage

The drawable resource ID of the custom background image.

foregroundThreshold

The confidence threshold for the foreground. Pixels with a confidence value greater than or equal to this threshold are considered to be in the foreground. Value is coerced between 0 and 1, inclusive.

Constructors

Link copied to clipboard
constructor(context: Context, @DrawableRes backgroundImage: Int, foregroundThreshold: Double = DEFAULT_FOREGROUND_THRESHOLD)

Functions

Link copied to clipboard
open override fun applyFilter(videoFrameBitmap: Bitmap)