收藏
回答

AR的OSD检测,Marker移出镜头后updateAnchors还在一直更新?

this.session.on('addAnchors', anchors => {

                const anchor = anchors[0]

                const {

                    width,

                    height

                } = this.data

                console.log('addAnchors')

                if (anchor{

                    this.setData({

                        frameShow: true,

                        frameX: anchor.origin.x * width,

                        frameY: anchor.origin.y * height,

                        frameWidth: anchor.size.width * width,

                        frameHeight: anchor.size.height * height,

                    })

                }

            })

            this.session.on('updateAnchors', anchors => {

                const anchor = anchors[0]

                const {

                    width,

                    height

                } = this.data

                if (anchor{

                    this.setData({

                        frameX: anchor.origin.x * width,

                        frameY: anchor.origin.y * height,

                        frameWidth: anchor.size.width * width,

                        frameHeight: anchor.size.height * height,

                    })

                }

            })

            this.session.on('removeAnchors', anchors => {

                this.setData({

                    frameShow: false,

                })

            })


回答关注问题邀请回答
收藏

2 个回答

  • zhyemmmm
    zhyemmmm
    09-28

    基础库版本3.10.0,检测物体移出镜头后隔很久才监听到removeAnchors事件,参考的是官方的例子


    09-28
    有用 1
    回复
  • 智能回答 智能回答 本次回答由AI生成
    09-28
    有用
登录 后发表内容