Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
int A[]={1,2,3,4};
	
	CvMat *src=cvCreateMat(2,2,CV_64FC1);
	src->data.i=A;
	

	cout<< cvDet(src)<<endl; //must be return -2 ,but the result show in screen is 3.92822e-252
Posted

1 solution

Here is declaration for cvDet in header:

C++
double cvDet(const CvArr* mat);


It should give a clue.

Here is documentation for cvDet - another clue.

Returns the determinant of a square floating-point matrix.

Try this:

C++
double A[]={1,2,3,4};

CvMat *srcA=cvCreateMat(2, 2, CV_64FC1);
srcA->data.db = A;
cout << cvDet(srcA) << endl;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900