//图形检测
let rectList = res.results
let labelList = res.labels
let myCanvas = this.$refs.myCanvas
var ctx = myCanvas.getContext('2d')
       var w = myCanvas.width;
       var h = myCanvas.height;
       ctx.clearRect(0, 0, w, h);
       let img = new Image()
       img.src = this.imageUrl
       img.onload = function(){
         let w = img.width*800/img.width;
         let h = img.height*600/img.height;
         myCanvas.width = w
         myCanvas.height = h
         ctx.drawImage(img, 0, 0,w,h)
         //位置框框
         ctx.beginPath();
         ctx.strokeStyle = 'red';
         ctx.lineWidth = 1;
         ctx.font = "20px serif";
         for(let i=0;i<rectList.length;i++){
           console.log("画框框")
           let x = (800/1600)*rectList[i][0]
           let y = (600/1300)*rectList[i][1]
           let width = (800/1600)*rectList[i][2] - x;
           let height = (600/1300)*rectList[i][3] - y;
           ctx.strokeRect(x, y, width, height);
           ctx.strokeText(labelList[i],x,y-5);
         }
         //标签
       }

        


      // ctx.clearRect(0, 0, w, h);
      // 在Canvas画布 添加图片
      // let img = new Image()
      // img.src = this.baseUrl +"/" + res.url
      // img.onload = function(){
      //   let w = img.width*800/img.width;
      //   let h = img.height*600/img.height;
      //   myCanvas.width = w
      //   myCanvas.height = h
      //   ctx.drawImage(img, 0, 0,w,h)
      //   loadingInstance.close();
      // }