To convert a cv::Mat to CvArr*

Go To StackoverFlow.com

2

I am using the transpose function cvTranspose to transpose a matrix. The code goes below:

CvMat matrix1, matrixTr;
double a[] = { 1,  2,  3,  4,
               5,  6,  7,  8,
               9, 10, 11, 12 };

CvMat matrix1=cvMat(3, 4, CV_64FC1, a);
cvTranspose(matrix1,matrixTr); 

This is where the error comes:cannot convert 'CvMat {aka CvMat}' to 'constCvArr* {aka const void*}' for argument '1' to 'void cvTranspose(const CvArr*, CvArr)'

I quite new to programming ...plz do let me know ur thoughts and suggestions...!!

2012-04-04 05:43
by cameo


1

cvTranspose takes 2 pointers to CvArr, CvMat is derived from CvArr, so you should do the following :

cvTranspose(&matrix1, &matrixTr);
2012-04-04 12:37
by Adrien
Thanx Adrien.... ! : - cameo 2012-04-05 05:30
Ads