Ask Your Question
1

Matrix multiplication

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

Rogeeeer gravatar image

Hi,

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
0

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

Entreco gravatar image

The * operator is available by this function:

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

For documentation look here: http://opencv.willowgarage.com/documentation/operations_on_arrays.html#mul

edit flag offensive delete link more
0

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

Guanta gravatar image

The *operator is overloaded, see http://docs.opencv.org/modules/core/doc/basic_structures.html#matrix-expressions 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

Stats

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

Seen: 4,045 times

Last updated: May 15 '13