MCPcopy Create free account
hub / github.com/creatale/node-dv / cvDet

Function cvDet

deps/opencv/modules/core/src/lapack.cpp:1644–1676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1642
1643
1644CV_IMPL double
1645cvDet( const CvArr* arr )
1646{
1647 if( CV_IS_MAT(arr) && ((CvMat*)arr)->rows <= 3 )
1648 {
1649 CvMat* mat = (CvMat*)arr;
1650 int type = CV_MAT_TYPE(mat->type);
1651 int rows = mat->rows;
1652 uchar* m = mat->data.ptr;
1653 int step = mat->step;
1654 CV_Assert( rows == mat->cols );
1655
1656 #define Mf(y, x) ((float*)(m + y*step))[x]
1657 #define Md(y, x) ((double*)(m + y*step))[x]
1658
1659 if( type == CV_32F )
1660 {
1661 if( rows == 2 )
1662 return det2(Mf);
1663 if( rows == 3 )
1664 return det3(Mf);
1665 }
1666 else if( type == CV_64F )
1667 {
1668 if( rows == 2 )
1669 return det2(Md);
1670 if( rows == 3 )
1671 return det3(Md);
1672 }
1673 return cv::determinant(cv::Mat(mat));
1674 }
1675 return cv::determinant(cv::cvarrToMat(arr));
1676}
1677
1678
1679CV_IMPL double

Callers

nothing calls this directly

Calls 3

determinantFunction · 0.85
MatClass · 0.85
cvarrToMatFunction · 0.85

Tested by

no test coverage detected