Ask Your Question
1

Matrix multiplication

asked May 15 '13

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); ?

Preview: (hide)

2 answers

Sort by » oldest newest most voted
0

answered May 15 '13

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

Preview: (hide)
0

answered May 15 '13

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).

Preview: (hide)

Question Tools

Stats

Asked: May 15 '13

Seen: 4,159 times

Last updated: May 15 '13