Ask Your Question
0

How to element-wise multiplication of Mat.

asked 2019-04-23 07:34:23 -0600

hua gravatar image
    Mat A;
    Mat B;
    Mat C;

    C = A * B; //element_wise;

Expected result:
Assume

    A =  [a, b, c; 
          d, e, f; 
          g, h, i]; 

    B =  [1, 2, 3; 
          4, 5, 6; 
          7, 8, 9]; 

    C =  [a * 1, b * 2, c * 3; 
          d * 4, e * 5, f * 6; 
          g * 7, h * 8, i * 9]; 

    Can I use the cv::multiply(A, B, C); ?
edit retag flag offensive close merge delete

Comments

C = A * B; //element_wise;

no, that's a matrix multiplication, not element-wise

berak gravatar imageberak ( 2019-04-23 07:35:51 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-04-23 07:36:42 -0600

berak gravatar image

Can I use the cv::multiply(A, B, C); ?

yes.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-04-23 07:34:23 -0600

Seen: 1,476 times

Last updated: Apr 23 '19