Ask Your Question
0

Opencv.js Subtract function doesn't give desired output

asked 2020-05-13 23:44:03 -0600

Vivek1may gravatar image

I am following this tutorial, https://docs.opencv.org/3.4.10/dd/d4d...

'subtract' function in opencv.js is not working as expected.

let src = cv.imread('imageCanvasInput');
let logo = cv.imread('logoCanvasInput');
let dst = new cv.Mat();
let mask = new cv.Mat();
//cv.subtract(logo,src,dst);
cv.subtract(logo,src,dst,mask,-1);
cv.imshow('canvasOutput', dst);
src.delete(); dst.delete(); logo.delete(); mask.delete();

Whatever I try in subtract function, the "dst" mat always gives as white image.

Is there anything missed here for subtraction.

Note: The add function for the same image set working as expected

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-05-17 16:23:35 -0600

kpachinger gravatar image

Paste your code in the example link for an error message. That is most helpful, specifically in 2014. Maybe image mats are not the same size?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-13 23:44:03 -0600

Seen: 702 times

Last updated: May 17 '20