虚拟背景

在直播、会议等场景实现虚拟背景,实时精准分割,支持自定义背景:


Android 集成指引

Android 集成 SDK 指引,请参见 独立集成美颜特效

方法

setEffect(String effectName, int effectValue, String resourcePath, Map<String, String> extraInfo)
具体参数说明请参见 setEffect

虚拟背景设置

mXmagicApi.setEffect(EffectName.EFFECT_SEGMENTATION, 45, AppConfig.motionResPath + "/segmentMotionRes/video_segmentation_blur_45", null);

自定义背景设置

Map<String, String> extraInfo = new HashMap<>();
extraInfo.put("segType", "custom_background");
extraInfo.put("bgType", "0");
extraInfo.put("bgPath", imgPath);
mXmagicApi.setEffect(EffectName.EFFECT_SEGMENTATION, 0, AppConfig.motionResPath + "/segmentMotionRes/video_empty_segmentation", extraInfo);