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

Processing properties for background images. More...

## 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

Processing properties for background images.

## 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 algorithms to user for background processing.

- SEG_MODEL_AI (1): (Default) Use the algorithm suitable for all scenarios.
- SEG_MODEL_GREEN (2): Use the algorithm designed specifically for scenarios with a green screen background.

## ◆ greenCapacity

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

The accuracy range for recognizing background colors in the image. The value range is [0,1], and the default value is 0.5. The larger the value, the wider the range of identifiable shades of pure color. When the value of this parameter is too large, the edge of the portrait and the pure color in the portrait range are also detected. Agora recommends that you dynamically adjust the value of this parameter according to the actual effect.

Note
  This parameter only takes effect when `modelType` is set to `SEG_MODEL_GREEN`.

## ◆ screenColorType

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

The screen color:

- SCREEN_COLOR_AUTO (0): The SDK automatically selects the screen color.
- SCREEN_COLOR_GREEN (1): Green.
- SCREEN_COLOR_BLUE (2): Blue.