当前位置:   article > 正文

uni-app人脸检测和人脸比对_uni-app 人脸对比虹软

uni-app 人脸对比虹软

// 人脸检测  和 人脸比对   百度ai人脸检测


 

// 1.获取access_token

    // 每次更新access_token  

    // 获取client_id  和 client_secret使用百度ai的   下面这个已经失效

  1.     // client_id=YXtYiFxEUU7OBFF4sG6K1v88&client_secret=j1a5FdWp4jvGzwS0n37hzy1kKh9rIQog
  2.     //
  3.     uni.request({
  4.         url: "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=YXtYiFxEUU8OBFF4sG6K1v88&client_secret=j0a5FdWp4jvGzwS0n37hzy1kKh9rIQog",
  5.         method'POST',
  6.         dataType: "json",
  7.         header: {
  8.             'content-type''application/json'
  9.         },
  10.         success: function(res) {
  11.             that.access_token = res.data.access_token
  12.         }
  13.     })


 

    // 2.人脸检测

  1. <view class="page-body-wrapper">
  2.     <camera v-show="openCamera" device-position="front" :flash="flash" binderror="error" style="width:100%" :style='{height:windowHeight+"px"}'>
  3.         <cover-view style="background: transparent;" class="corver-view">
  4.                 {
  5. {trackshow_text}}
  6.         </cover-view>
  7.     </camera>
  8.     <canvas v-if="canvasshow" :style='{height:windowHeight+"px"}' style="width: 100%;position:absolute;" canvas-id="canvas"></canvas>
  9. </view>

 //拍照头像 调用相机拍照

  1.             takePhoto(){
  2.                 var that = this
  3.                 var takephonewidth;
  4.                 var takephoneheight;
  5.                 that.ctxHead.takePhoto({
  6.                     quality'high',
  7.                     success(res) => {
  8.                         // console.log(res.tempImagePath),
  9.                         // 获取图片真实宽高
  10.                         uni.getImageInfo({
  11.  
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/423242
推荐阅读
相关标签
  

闽ICP备14008679号