赞
踩
// 人脸检测 和 人脸比对 百度ai人脸检测
// 1.获取access_token
// 每次更新access_token
// 获取client_id 和 client_secret使用百度ai的 下面这个已经失效
- // client_id=YXtYiFxEUU7OBFF4sG6K1v88&client_secret=j1a5FdWp4jvGzwS0n37hzy1kKh9rIQog
-
- //
-
- uni.request({
-
- url: "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=YXtYiFxEUU8OBFF4sG6K1v88&client_secret=j0a5FdWp4jvGzwS0n37hzy1kKh9rIQog",
-
- method: 'POST',
-
- dataType: "json",
-
- header: {
-
- 'content-type': 'application/json'
-
- },
-
- success: function(res) {
-
- that.access_token = res.data.access_token
-
- }
-
- })
// 2.人脸检测
- <view class="page-body-wrapper">
-
- <camera v-show="openCamera" device-position="front" :flash="flash" binderror="error" style="width:100%" :style='{height:windowHeight+"px"}'>
-
- <cover-view style="background: transparent;" class="corver-view">
-
- {
- {trackshow_text}}
-
- </cover-view>
-
- </camera>
-
- <canvas v-if="canvasshow" :style='{height:windowHeight+"px"}' style="width: 100%;position:absolute;" canvas-id="canvas"></canvas>
-
- </view>
//拍照头像 调用相机拍照
-
-
- takePhoto(){
-
- var that = this
-
- var takephonewidth;
-
- var takephoneheight;
-
- that.ctxHead.takePhoto({
-
- quality: 'high',
-
- success: (res) => {
-
- // console.log(res.tempImagePath),
-
- // 获取图片真实宽高
-
- uni.getImageInfo({
-
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。