Ask Your Question

Multiply Mat and Scalar not me

asked 2014-03-25 10:36:40 -0500

RossWell gravatar image

I coding by android studio using opencv.

I tried mutiply scalar with Mat but not working.

Mat A = new Mat();
Mat B = new Mat();
Mat C = new Mat();
Mat D = new Mat();
Scalar alpha = new Scalar(5);

I take this:

image description

and i multiply C with "alpha":


i wana D become :

image description

but D become :

image description

please help me..

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-12-11 20:10:55 -0500

lehoangphuc86 gravatar image

You can just simply use

Mat D=5*C;

I have tested in opencv with c++ in Ubuntu. Hope this help.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-03-25 10:36:40 -0500

Seen: 280 times

Last updated: Mar 25 '14