绿幕抠像

  • 绿幕bundle主要是用来作绿幕抠图使用的,用绿色或蓝色背景,抠图效果会更佳。

Module

类名

说明

core

BgSegGreen

绿幕抠像功能业务模型

1.1 BgSegGreen (green_screen.bundle)

绿幕抠像功能模型

1.1.1 属性定义

属性

说明

默认值

备注

enable

绿幕抠像开关

true

true表示开启,false表示关闭

isBGRA

BGRA类型

false

背景图片的颜色是否是BGRA类型

colorRGB

锚点颜色

FUColorRGBData(0.0, 255.0, 0.0)

选取的颜色RGB

similarity

相似度

0.518

取值范围0.0-1.0,相似度:色度最大容差,色度最大容差值越大,更多幕景被抠除

smoothness

平滑度

0.22

取值范围0.0-1.0,平滑:色度最小限差,值越大,更多幕景被扣除

transparency

透明度

0.0

取值范围0.0-1.0,透明度:图像前后景透明度过度,值越大,两者边缘处透明过度更平滑

centerPoint

中心坐标

FUCoordinate2DData(0.5, 0.5)

取值范围0.0-1.0,   [0.5,0.5]表示中心点坐标

zoom

缩放程度

1.0

取值范围0.25-4.0

1.1.2 创建自定义背景

接口说明

fun createBgSegment(rgba: ByteArray, width: Int, height: Int)

参数说明

rgba:图象Buffer width:图象宽 height:图象高

代码示例

bgSegGreen.createBgSegment(bytes, width, height);

1.1.3 移除自定义背景

接口说明

fun removeBgSegment()

代码示例

bgSegGreen.removeBgSegment();

1.1.4 创建自定义安全区域

接口说明

createSafeAreaSegment(rgba: ByteArray, width: Int, height: Int)

参数说明

rgba:图象Buffer width:图象宽 height:图象高

代码示例

bgSegGreen.createSafeAreaSegment(bytes, width, height);

1.1.5 移除自定义安全区域

接口说明

fun removeSafeAreaSegment()

代码示例

bgSegGreen.removeSafeAreaSegment();

1.1.6 构造BgSegGreen

接口说明

class BgSegGreen(val bundle: FUBundleData)

参数说明

bundle:通过绿幕抠像Bundle文件构造的文件数据模型

代码示例

BgSegGreen bgSegGreen = new BgSegGreen(new FUBundleData(DemoConfig.BUNDLE_BG_SEG_GREEN));

 


< 上一页: 动作识别
下一页: 美体 >