SegmentationProperty
背景图像的处理属性。
public class SegmentationProperty { public static final int SEG_MODEL_AI = 1; public static final int SEG_MODEL_GREEN = 2; public int modelType; public float greenCapacity; public SegmentationProperty(int modelType, float greenCapacity) { this.modelType = modelType; this.greenCapacity = greenCapacity; } public SegmentationProperty() { this.modelType = SEG_MODEL_AI; this.greenCapacity = 0.5f; } }
属性
- modelType
- 进行背景处理的算法。
- SEG_MODEL_AI(1): (默认) 适用于所有场景下的背景处理算法。
- SEG_MODEL_GREEN(2): 仅适用于绿幕背景下的背景处理算法。
- greenCapacity
-
对画面中绿颜色(即不同程度的绿色)识别的精度范围。取值范围为 [0,1],默认值为 0.5。取值越大,代表可识别的绿色范围越大。当该参数取值过大时,人像边缘和人像范围内的绿色也会被识别。建议你根据实际效果动态调整该参数的值。
注: 该参数仅在 modelType 设置为 SEG_MODEL_GREEN 时生效。