double a[] = {
1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12};
double b[] = { 1, 5, 9,
2, 6, 10,
3, 7, 11,
4, 8, 12 };
double c[9];
CvMat Ma, Mb, Mc;
printf("\n=== Test multiply ===");
cvInitMatHeader( &Ma, 3, 4, CV_64FC1, a, CV_AUTOSTEP );
cvInitMatHeader( &Mb, 4, 3, CV_64FC1, b, CV_AUTOSTEP );
cvInitMatHeader( &Mc, 3, 3, CV_64FC1, c, CV_AUTOSTEP );
cvMatMulAdd( &Ma, &Mb, 0, &Mc );
PrintMat(&Ma);
PrintMat(&Mb);
PrintMat(&Mc);
FR:海涛高软(hunk Xu) QQ技术交流群:386476712