Class SegmentationProperty

java.lang.Object
io.agora.rtc2.video.SegmentationProperty

public class SegmentationProperty extends Object
The properties for virtual background algorithm.
  • Field Details

    • SEG_MODEL_AI

      public static final int SEG_MODEL_AI
      1: (Default) AI segmentation algorithm.
      See Also:
    • SEG_MODEL_GREEN

      public static final int SEG_MODEL_GREEN
      2: Green screen segmentation algorithm.
      See Also:
    • SCREEN_COLOR_AUTO

      public static final int SCREEN_COLOR_AUTO
      0: (Default) Automatically recognizes the screen color.
      See Also:
    • SCREEN_COLOR_GREEN

      public static final int SCREEN_COLOR_GREEN
      1: Green.
      See Also:
    • SCREEN_COLOR_BLUE

      public static final int SCREEN_COLOR_BLUE
      2: Blue.
      See Also:
    • modelType

      public int modelType
      The type of segmentation algorithm. See #SEG_MODEL_AI and #SEG_MODEL_GREEN. The default value is `SEG_MODEL_AI`.
    • greenCapacity

      public float 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

      public int 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`.
  • Constructor Details

    • SegmentationProperty

      public SegmentationProperty(int modelType, float greenCapacity)
    • SegmentationProperty

      public SegmentationProperty()