opencv 矩阵乘法

来源:互联网 发布:sql serverr2安装教程 编辑:程序博客网 时间:2024/05/16 19:21

cvMul进行逐点相乘。

矩阵相乘应使用cvGEMM函数

GEMM

Performs generalized matrix multiplication

void  cvGEMM( const CvArr* src1, const CvArr* src2, double alpha,              const CvArr* src3, double beta, CvArr* dst, int tABC=0 );#define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( src1, src2, 1, src3, 1, dst, 0 )#define cvMatMul( src1, src2, dst ) cvMatMulAdd( src1, src2, 0, dst )

src1
The first source array.
src2
The second source array.
src3
The third source array (shift). Can be NULL, if there is no shift.
dst
The destination array.
tABC
The operation flags that can be 0 or combination of the following values:
CV_GEMM_A_T - transpose src1
CV_GEMM_B_T - transpose src2
CV_GEMM_C_T - transpose src3
for example, CV_GEMM_A_T+CV_GEMM_C_T corresponds to
alpha*src1T*src2 + beta*srcT

The function cvGEMM performs generalized matrix multiplication:

dst = alpha*op(src1)*op(src2) + beta*op(src3), where op(X) is X or XT

All the matrices should have the same data type and the coordinated sizes. Real or complex floating-point matrices are s

0 0
原创粉丝点击