Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Product of two matrices

Hi,

I use OpenCV 2.4.4 with Java. I have problem with simple multiplication of two matrices. I define it in my code in following way:

Mat m1 = Mat.ones(3, 3, CvType.CV_16SC1);

Mat m2 = Mat.ones(3, 3, CvType.CV_16SC1);

In case if I multiply:

Mat m3 = m1 * m2;

I achieved error that operator * is undefined.

I know that OpenCv for Java provides function mul and i can use it:

Mat m3 = m1.mul(m2);

but in this way I receive only product of elementwise multiplication what is not my objective.

Is there some replacement function which allow me to multiply two matrices like * operator?

Thanks in advance :)