不报错吗[图片]
使用createVKSession无法触发updateAnchors,检测不到人脸?onReady: function (e) { this.session = wx.createVKSession({ track: { face: { mode: 1 } // mode: 1 - 使用摄像头;2 - 手动传入图像 }, }); this.startDetecting(); }, takePhoto() { const ctx = wx.createCameraContext() console.log('Taking photo...'); ctx.takePhoto({ quality: 'high', success: (res) => { console.log('Photo taken successfully.'); this.setData({ src: res.tempImagePath }) }, fail: (err) => { console.log('Failed to take photo: ', err); } }) }, error(e) { console.log('Camera error: ', e.detail); }, startDetecting: function () { this.session.on('updateAnchors', anchors => { console.log('updateAnchors', anchors); 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) }); }); this.session.on('removeAnchors', () => { console.log('removeAnchors'); }); this.session.start(errno => { if (errno) { console.log("VKSession start failed: ", errno); } else { console.log("VKSession start successfully"); } }); }, stopDetecting: function () { this.session.stop(); },
2023-05-12