在微信小程序开发WebAR。
技术支持QQ群:722979533
<camera frame-size="medium" bindinitdone="cameraInitDone" mode="normal"
device-position="back" resolution="medium" flash="off" />
<canvas type="2d" id="canvas" style="width:1px; height: 1px;" />
import { WebAr } from "../../utils/WebAr";
const CONFIG = {
token: '认证token', // 认证token, 请从开发者中心获取
endpoint: 'https://iss-api.wujianar.cn',
quantity: 0.7, // 图片压缩质量, 0~1
interval: 1000, // 识别间隔(毫秒)
}
this.webAr = new WebAr(CONFIG, res[0].node);
this.webAr.searchCallback(res => {
// TODO: 识别成功后的回调
});
this.webAr.startSearch();
this.webAr.stopSearch();
示例下载: https://gitee.com/wujianar/mini-webar
小程序WebAR相册: https://gitee.com/wujianar/mini-webar-album