I have a question which might be for beginners.
I want to multiply a 20×2 matrix by a 2×2 matrix in c++.
I tried it with openCV but I get an error which is
Bad argument (Unknown array type) in cvarrToMat
Here is the code that I used in openCV in order to check the problem if it was with my code or the problem in the openCV but it still not working, I can compile with out error, but when I test the code I get the problem ” Bad argument (Unknown array type) in cvarrToMat”
#include <stdio.h>
#include <stdlib.h>
//#include "/usr/include/opencv/cv.h"
#include <cv.h>
#include <cvaux.h>
#include <highgui.h>
#include <math.h>
#include <iostream>
int main()
{
double a[] = {1, 2, 3, 4};
CvMat Ma;
cvInitMatHeader(&Ma, 2, 2, CV_32FC1, a);
double b[] ={0, -1, 1, 0};
CvMat Mb;
cvInitMatHeader(&Mb, 2, 2, CV_32FC1, b);
CvMat Mc;
CvMat Mc1;
cvMatMul(&Ma, &Mb, &Mc);
return 0;
}
May be you should post the prototype of the function you are calling, as well as the declaration of your matrices and your call. I don’t think everyone is familiar with a openCV.