How to do element wise division in java using Mat.mul?
Suppose I have to Mat,i want to do element wise division(m1./m2), Then how to do it using Mat.mul method?
Suppose I have to Mat,i want to do element wise division(m1./m2), Then how to do it using Mat.mul method?
i guess, the problem is, that you found a Mat.mul() member function, but there is no Mat.div() or similar.
use Core.divide(src1, src2, dst) in that case.
yes, that's element-wise. (there is a matrix multiplication in maths, but no such counterpart for division).
Asked: 2016-12-22 03:13:33 -0600
Seen: 1,614 times
Last updated: Dec 22 '16
what are m1, m2, exactly ? why do you want to use mult() for division ?
you can replace division by multiplication only, if m2 is a scalar.
Mat m1=new Mat(); Mat m2=new Mat();
Now I want to divide m1 & m2 elementwise, So what should be scalar value?
ok, let me clarify, if m is a matrix, and you have a number, like 5, you can replace the m/5 division by multiplying by 0.2. (but this is only valid for single numbers (Scalars))