Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resizeImg(){
- const img_rgb = cv.imread(this.canvasInput.nativeElement.id);
- let img_adapted = new cv.Mat();
- let img_gray = new cv.Mat();
- let resized = new cv.Mat();
- let dsize = new cv.Size(200, 200);
- cv.cvtColor(img_rgb, img_gray, cv.COLOR_BGR2GRAY,0);
- cv.adaptiveThreshold(img_gray,img_adapted,255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY, 11, 2);
- //let img_stacked = tf.layers.repeatVector({n: 3, inputShape: [2]})
- //cv.resize(img_stacked, resized, dsize, 0, 0, cv.INTER_AREA);
- //cv.imshow('canvasOutput',img_adapted);
- //const img_stacked = tf.repeat(img_adapted,3,axis=2);
- //console.log(img_stacked);
- //console.log("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
- //return bg_img;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement