I want to use addweighted function with opencv.js. I've attached opencv.js to my HTML
<script src="opencv.js"></script>
And here is the code that I use
const image1 = cv.imread(imgElement);
const image2 = image.clone(); //image2 is cloned from image1 to be sure that they have the same size
const addWeightedMat = new cv.Mat(image1.rows, image1.cols, image1.type());
const alpha = 0.7;
const betta = 0.3;
const gamma = 0;
cv.addWeighted(image1, alpha, image2, betta, addWeightedMat, gamma);
The Error message says
Uncaught TypeError: Cannot convert "[object Object]" to double
How can I fix this?