Ask Your Question

Matrix multiplication

asked 2013-05-15 08:04:23 -0500

Rogeeeer gravatar image


I have to reimplement some methods from opencv for real time operations. But some of these are using gemm for "simple" matrix multiplication.

Looking in the sources I can't find the operator* for cv::Mat.

When I write something like C = A*B (with A, B, C cv::Mat). Does it call gemm(A, B, 1.0, Mat(), 0.0, C); ?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-05-15 08:29:34 -0500

Entreco gravatar image

The * operator is available by this function:

cvMul(<#const CvArr *src1#>, <#const CvArr *src2#>, <#CvArr *dst#>)

For documentation look here:

edit flag offensive delete link more

answered 2013-05-15 09:14:07 -0500

Guanta gravatar image

The *operator is overloaded, see and it works as expected (and as you wrote it). Please also use the newer C++ interface instead of the C-interface (as Entreco suggested).

edit flag offensive delete link more

Question Tools


Asked: 2013-05-15 08:04:23 -0500

Seen: 3,689 times

Last updated: May 15 '13