this.cameraEngine = wx.createCameraContext()
this.VKSession = wx.createVKSession({
track: {
face: { mode: 2 }
}
})
this.VKSession.on('updateAnchors', anchors => {
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)
})
})
this.VKSession.start(errno => {
if (errno) return
const listener = this.cameraEngine.onCameraFrame((frame) => {
if (this.isVerify) return
this.VKSession.detectFace({
frameBuffer: frame.data,
width: frame.width,
height: frame.height,
scoreThreshold: 0.8,
sourceType: 0,
modelMode: 1,
open3d: true
})
})
listener.start()
})
目前需要开发者自行设计遮挡算法