收藏
回答

执行VKSession.runOCR后,为什么没有收到识别回调?

如下代码

this.session = wx.createVKSession({
    track: {
        OCR: {
            mode: 2
        } 
    },
    version: 'v1',
});

this.session.on('updateAnchors', anchors => {
    console.log(TAG, 'init VisionKit updateAnchors', JSON.stringify(anchors));
    anchors.map((anchor) => {
        console.log('init VisionKit updateAnchors text', anchor.text);
    });
})

this.session.start(errno => {
    logger.info(TAG, 'init VisionKit error:', errno);
    if (errno) {
        return;
    }
});

this.session?.runOCR({
    frameBuffer: this.imgData.data.buffer,
    width: this.data.ocrImgOriginWidth,
    height: this.data


如标题所描述:拍照或者返回照片后,进行ocr识别,没有反应,

微信版本:8.0.32

小程序基础库版本:2.30.0,

但是同样的代码,微信版本降级到8.0.28后,对应的小程序库版本是2.27.3,这段代码就可以识别出文字,

请大神帮忙看下是什么原因?

最后一次编辑于  2023-01-30
回答关注问题邀请回答
收藏

5 个回答

登录 后发表内容