how to multiply Mat with number (opencv in android ) [closed]

asked 2014-03-25 05:55:21 -0600

RossWell gravatar image

I'm working in Mat of opencv in android studio.

i wanna:

Mat A;

Mat B;

int alpha = 5;

B = A*5;

not working.

plz help me take it.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-08-22 11:18:11.747117

Comments

i code with android studio not c++.

no use loop. in the docs doesn't talk about this

RossWell gravatar imageRossWell ( 2014-03-25 06:09:47 -0600 )edit

compliler error : in Mat cannot be applied to "int"

RossWell gravatar imageRossWell ( 2014-03-25 06:31:02 -0600 )edit
1

(sorry, had it wrong before)

http://docs.opencv.org/java/org/opencv/core/Core.html#multiply(org.opencv.core.Mat,%20org.opencv.core.Scalar,%20org.opencv.core.Mat)

so that's:

Mat A;

Mat B = new Mat(); // result

Scalar alpha = new Scalar(5); // the factor

Core.multiply(A,alpha,B);

berak gravatar imageberak ( 2014-03-25 06:31:37 -0600 )edit

here Mat with Mat. but i wana Mat with number.

plz

RossWell gravatar imageRossWell ( 2014-03-25 06:58:50 -0600 )edit

im try... thanks [break]

RossWell gravatar imageRossWell ( 2014-03-25 06:59:51 -0600 )edit