Advertisement
mouhphune

Untitled

May 14th, 2020
1,842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   resizeImg(){
  2.  
  3.     const img_rgb = cv.imread(this.canvasInput.nativeElement.id);
  4.     let img_adapted = new cv.Mat();
  5.     let img_gray = new cv.Mat();
  6.     let resized = new cv.Mat();
  7.     let dsize = new cv.Size(200, 200);
  8.     cv.cvtColor(img_rgb, img_gray, cv.COLOR_BGR2GRAY,0);
  9.     cv.adaptiveThreshold(img_gray,img_adapted,255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY, 11, 2);
  10.     //let img_stacked = tf.layers.repeatVector({n: 3, inputShape: [2]})
  11.  
  12.  
  13.  
  14.     //cv.resize(img_stacked, resized, dsize, 0, 0, cv.INTER_AREA);
  15.  
  16.  
  17.     //cv.imshow('canvasOutput',img_adapted);
  18.     //const img_stacked = tf.repeat(img_adapted,3,axis=2);
  19.  
  20.    
  21.     //console.log(img_stacked);
  22.     //console.log("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
  23.    
  24.     //return bg_img;
  25.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement