I want to multiply a matrix with a number !
I am using opencv in android studio.
i want:
Mat A;
Mat B;
int num= 255;
B = A*255;
But it is not working.
there are no builtin 'operators' for this in java, you'll have to use Core.multiply , like:
Mat A = ...;
Mat B = new Mat();
Scalar s = new Scalar(13);
Core.multiply(A, s, B);
note, since B will get saturated on overflow, you probably need to convert A to a larger type, like CV_32F
Asked: 2016-02-24 01:20:50 -0600
Seen: 3,745 times
Last updated: Feb 24 '16