微信程序WebAR识别,开发简单,识别速度快。
开发步骤
1 .上传识别图
在官方网站注册(https://wujianar.com)即可申请免费画廊。
2 .守护程序代码
下载官网小程序demo代码:https://gitee.com/wujian ar/mini-webar。
3 .将相机和相机添加到3. wxml文件
camera frame-size=' medium ' bindinitdone=' camerainitdone ' mode=' normal ' device-position=' back ' resolution=将WebAr SDK导入'/4. js文件
import { webar } from ' ././utils/webar '; 5 .设置认证令牌等
const config={ Token : ' ytu5njgxyz5* * * * * * ',/认证token可从开发人员中心获得endpoint : ' https://ISS-cn1.wujian ar .
this.webar=newwebar(config,res[0].node ); this.webar.search callback (RES={//todo :识别成功后的回调} ); 7 .打开/关闭识别
this.webAr.startSearch (; this.webAr.stopSearch (;