我从cvdet()函数返回结果有问题 [英] i have problem in result return from cvdet() function

查看:82
本文介绍了我从cvdet()函数返回结果有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

这是标题中cvDet的声明:



Here is declaration for cvDet in header:

double cvDet(const CvArr* mat);





它应该给出一个线索。



这里是cvDet的文档 - 另一个线索。



返回方形浮点矩阵的行列式。



试试这个:





It should give a clue.

Here is documentation for cvDet - another clue.

Returns the determinant of a square floating-point matrix.

Try this:

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

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


这篇关于我从cvdet()函数返回结果有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆