Package io.agora.rtc2.video
Class SegmentationProperty
java.lang.Object
io.agora.rtc2.video.SegmentationProperty
The properties for virtual background algorithm.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloatThe color tolerance for green screen segmentation.intThe type of segmentation algorithm.static final int0: (Default) Automatically recognizes the screen color.static final int2: Blue.static final int1: Green.intThe color of the screen for green screen segmentation.static final int1: (Default) AI segmentation algorithm.static final int2: Green screen segmentation algorithm. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SEG_MODEL_AI
public static final int SEG_MODEL_AI1: (Default) AI segmentation algorithm.- See Also:
-
SEG_MODEL_GREEN
public static final int SEG_MODEL_GREEN2: Green screen segmentation algorithm.- See Also:
-
SCREEN_COLOR_AUTO
public static final int SCREEN_COLOR_AUTO0: (Default) Automatically recognizes the screen color.- See Also:
-
SCREEN_COLOR_GREEN
public static final int SCREEN_COLOR_GREEN1: Green.- See Also:
-
SCREEN_COLOR_BLUE
public static final int SCREEN_COLOR_BLUE2: Blue.- See Also:
-
modelType
public int modelTypeThe type of segmentation algorithm. See #SEG_MODEL_AI and #SEG_MODEL_GREEN. The default value is `SEG_MODEL_AI`. -
greenCapacity
public float greenCapacityThe 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
public int screenColorTypeThe 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`.
-
-
Constructor Details
-
SegmentationProperty
public SegmentationProperty(int modelType, float greenCapacity) -
SegmentationProperty
public SegmentationProperty()
-