How to multiply cv.Mat by scalar in JS?

asked 2020-05-03 14:00:08 -0500

mikit gravatar image

updated 2020-05-03 21:06:24 -0500

supra56 gravatar image

We cannot use operator* unlike C++.

It seems cv.multiply is only for mat * mat (element-wise).

How can I multiply Mat by scalar?

Currently, I use cv.multiply(mat, cv.ones(h, w, cv.CV_8UC1), 255)

edit retag flag offensive close merge delete