Agora Java API Reference for Android
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
io.agora.rtc2.video.SegmentationProperty Class Reference

Public Member Functions

 SegmentationProperty (int modelType, float greenCapacity)
 

Public Attributes

int modelType
 
float greenCapacity
 
int screenColorType
 

Static Public Attributes

static final int SEG_MODEL_AI = 1
 
static final int SEG_MODEL_GREEN = 2
 
static final int SCREEN_COLOR_AUTO = 0
 
static final int SCREEN_COLOR_GREEN = 1
 
static final int SCREEN_COLOR_BLUE = 2
 

Detailed Description

The properties for virtual background algorithm.

Member Data Documentation

◆ SEG_MODEL_AI

final int io.agora.rtc2.video.SegmentationProperty.SEG_MODEL_AI = 1
static

1: (Default) AI segmentation algorithm.

◆ SEG_MODEL_GREEN

final int io.agora.rtc2.video.SegmentationProperty.SEG_MODEL_GREEN = 2
static

2: Green screen segmentation algorithm.

◆ SCREEN_COLOR_AUTO

final int io.agora.rtc2.video.SegmentationProperty.SCREEN_COLOR_AUTO = 0
static

0: (Default) Automatically recognizes the screen color.

◆ SCREEN_COLOR_GREEN

final int io.agora.rtc2.video.SegmentationProperty.SCREEN_COLOR_GREEN = 1
static

1: Green.

◆ SCREEN_COLOR_BLUE

final int io.agora.rtc2.video.SegmentationProperty.SCREEN_COLOR_BLUE = 2
static

2: Blue.

◆ modelType

int io.agora.rtc2.video.SegmentationProperty.modelType

The type of segmentation algorithm. See SEG_MODEL_AI and SEG_MODEL_GREEN. The default value is SEG_MODEL_AI.

◆ greenCapacity

float io.agora.rtc2.video.SegmentationProperty.greenCapacity

The color tolerance for green screen segmentation.

This parameter is only effective when modelType is set to SEG_MODEL_GREEN. The value ranges from 0.0f to 1.0f, with a default of 0.5f. A larger value widens the range of identifiable shades of the screen color. Setting the value too high may cause parts of the portrait to be detected as the background. Agora recommends dynamically adjusting this value based on the observed segmentation effect.

◆ screenColorType

int io.agora.rtc2.video.SegmentationProperty.screenColorType

The color of the screen for green screen segmentation. See SCREEN_COLOR_AUTO, SCREEN_COLOR_GREEN, and SCREEN_COLOR_BLUE.

This property is only for green screen segmentation. The default value is SCREEN_COLOR_AUTO.