session.on('updateAnchors',()=>{})根本监听不到,回调无效?
// 创建 session 对象 this.session = wx.createVKSession({ track: { plane: { mode: 3 }, face: { mode: 1 } // mode: 1 - 使用摄像头;2 - 手动传入图像 }, }) // 摄像头实时检测模式下,监测到人脸时,updateAnchors 事件会连续触发 (每帧触发一次) this.session.on('updateAnchors', anchors => { this.session.update3DMode({ open3d: true }) anchors.forEach(anchor => { console.log('anchor.points', anchor.points) console.log('anchor.origin', anchor.origin) console.log('anchor.size', anchor.size) console.log('anchor.angle', anchor.angle) }) }) // 当人脸从相机中离开,会触发 removeAnchors 事件 this.session.on('removeAnchors', () => { console.log('人脸从相机中离开时removeAnchors') }) this.session.start(errno => { if (errno) { console.log("失败", errno) } else { console.log("成功开启会话") } })