hyExt.reg.onHumanContourDetection
- 监听当前直播间人体轮廓点检测消息
- 双面镜、两屏、三屏的时候提示接口不支持
- 引入版本 1.8.0
- 适用终端
- 虎牙直播助手-iOS:未实现
- 虎牙直播助手-安卓:未实现
- 虎牙直播PC客户端-主播侧:4.16.1.0
接口签名
declare namespace hyExt {
module reg {
/**
* 监听当前直播间人体轮廓点检测消息
* @param param 输入参数
*/
function onHumanContourDetection(
param: HumanContourDetectionReq
): Promise<void>
}
/**
* 人体轮廓识别消息参数
*/
type HumanContourDetectionReq = {
/**
* 画布信息
*/
callback: HumanCallback
}
/**
* 画布信息
* @param recognition 人体轮廓识别消息
*/
type HumanCallback = (recognition: HumanInfo) => void
/**
* 人体轮廓识别消息
*/
type HumanInfo = {
/**
* 画布信息
*/
canvas: CanvasInfo
/**
* 轮廓点
*/
contourPoints: ContourPointInfo[]
/**
* 轮廓数,值域为正整数
*/
contourCount: number
}
/**
* 画布信息
*/
type CanvasInfo = {
/**
* 画布宽度
*/
width: number
/**
* 画布高度
*/
height: number
}
/**
* 轮廓点信息
*/
type ContourPointInfo = {
/**
* 横坐标(值域 [0, 画布宽],单位是像素)
*/
x: number
/**
* 纵坐标(值域 [0, 画布高],单位是像素)
*/
y: number
}
}
示例代码
hyExt.reg
.onHumanContourDetection({
callback: (recognition) => {
const { canvas, contourPoints, contourCount } = recognition
console.log("回调触发", recognition)
},
})
.then(() => {
console.log("调用hyExt.reg.onHumanContourDetection成功")
})
.catch((err) => {
console.log("调用hyExt.reg.onHumanContourDetection失败", err)
})
生命周期
直播间信息
环境信息
弹幕
礼物
文本秩序审核
小程序消息
终端事件监听
KV存储
主播端白板
网络库
文件处理
外部EXE能力
浮窗
小程序付费功能
订阅
直播间分享事件
守护事件
贵族事件
高级用户进场事件
小程序入口控制
本地小程序控制
语音识别事件
手势识别事件
视觉识别事件
人体轮廓点检测事件
肢体骨骼点检测事件
人脸特征点检测事件
播放视频
直播间视频
后台相关